1. ls for listing the files as well as directories those are kept in the particular working directory syntax
ls -l
above the command will list the files with rights details
ls -a
above the command will list all the files including hidden files
ls -i
it will also shows us the inode number of each and every file
syntax :
ls [OPTION]... [FILE]...
Example :
senthil@senthil-desktop:ls -la
2. clear
it will clear the screen (short cut ctl+l).
syntax :
clear
Example :
senthil@senthil-desktop:clear
3. exit
to end a current session as well current terminal logging
syntax :
exit
Example :
senthil@senthil-desktop:exit
4. touch
to create a new empty file
syntax :
touch file_name
Example :
senthil@senthil-desktop:touch testing.txt
5. cd
to change the working/present directory
syntax :
cd director_path
Example :
senthil@senthil-desktop:cd Desktop/project
6. mkdir
to make a new directory
syntax :
mkdir dir_name
Example :
senthil@senthil-desktop:mkdir testing
you can also create a directory at your desired path without changing your present working directory
7. rmdir
to remove a empty directory
syntax :
rmdir dir_name
Example :
senthil@senthil-desktop:rmdir testing
8. rm
to remove a empty file
rm [-i/-r/-f] to remove a directory with its subdirectories as well as its
files that is to remove a directory which already contains some files in it
syntax :
rm file_name
Example :
senthil@senthil-desktop:rm testing.txt
-i stands for interactively
-r stands for recursively
-f stands for forcefully
9. cp
to copy something in a destination file or directory
syntax :
cp sourcepath destinationpath
example:
senthil@senthil-desktop:cp /home/mango/webmin.rpm /root/abcd
10. mv
to move one file or directory from one place to another place, it
is also used for renaming adirectory or file
syntax :
mv source destination
Example :
senthil@senthil-desktop: mv oldfilename newfilename
How to create User in Mysql?
How to create User in Mysql
Create new user in Mysql
We can create MySQL accounts in two ways, By using statements such as Create user and Grant.
1.CREATE USER
Syntax
CREATE USER 'user_name'@ 'host_name' [IDENTIFIED BY [PASSWORD] 'password']
Example
CREATE USER 'senthil'@ 'localhost' identified by 'admin';
Note
It must be noted that CREATE USER command was added in the MySQL version 5.0.2. In earlier versions, users could be created automatically when assigning permissions using the GRANT command or by manually inserting records in the mysql database.
It must be noted that CREATE USER command was added in the MySQL version 5.0.2. In earlier versions, users could be created automatically when assigning permissions using the GRANT command or by manually inserting records in the mysql database.
2.Grant User
Syntax
GRANT [PRIVILIAGES] ON 'database_name'.'table_name' TO ''user_name'@ ''host_name' IDENTIFIED BY 'password';
Example
GRANT ALL ON 'test'.* TO ''senthil'@ ''localhost' IDENTIFIED BY 'admin';
To see a list of the userd and their privileges.
use mysql;
select * from mysql.user where User='user' \G;
Subscribe to:
Posts (Atom)