You are on page 1of 7

Who -> This command is used to display all the users.

Syntax- who

Who am I -> This is used to display the name of current user only.
Syntax- who am i

Mkdir -> This command is used to create a directory.


Syntax- mkdir directory name

Cd-> This command is used to change a directory.


Syntax- cd dir name

Pwd (Present Working Directory)-> This command is used to


check the status where I am i.e it tells us the current status. Syntax- pwd

Vi (virtual editor)-> It is used for writing in a file or directory.


Syntax- vi file name I (enter the data) esc :wq

cat -> This command is used to show the content of the file. Syntax- cat file name Cp-> This command is used to copy the content of one file to another.
Syntax- cp source file destination file

mv-> This command is used to change the name of file.


Syntax- mv old name new name

Rm-> This command is used to delete a file.


Syntax- rm file name

Ln-> This command is used to create a link between two files so that if
updations occur in first file then copied file also updated. Syntax- ln f1 f2

cd.. -> This command is used to reach the parent directory.


Syntax- cd..

Rmdir-> This command is used to delete the directory. This command


can delete only those directories that are empty. Syntax- rmdir dir name

Rm r -> This command is used to delete a directory whether it is


empty or not. Syntax- rm r dir name

Ls-> This command is used to list all the files.


Syntax- ls

Ls l-> This command is used to get the information of all the files and
directory in a long listed way. Syntax- ls l

Ls a-> This command is used to get the details of hidden files also.
Syntax- ls a

Ls al-> This command is used to get the detail of hidden files in a


long listed way. Syntax- ls al

Date-> This command is used to display the current date of the server.
Syntax- date

Man -> This command is used to get the help.


Syntax- man (about which we want help)

Sort -> This command is used to sort the file but according to ASCII
values. Syntax- sort file name

Sort n -> This command is used to sort the content of file according
to numbers i.e not with ASCII values. Syntax- sort n file name

Sort nr -> This command is used to sort the file in descending order.
Syntax- sort nr file name

Wc(word count)-> This command is used to get the status of file.


Syntax- wc file name

W l -> This command is used to display the no of lines in a file


Syntax- w l file name

W w -> This command is used to display the no of words in a file.


Syntax- w w file name

W c -> This command is used to display the no of characters in a file.


Syntax- w c file name

Cal-> This command is used to display the calendar.


Syntax- cal month no year

Cut -> This command is used to delete particular column.


Syntax- cut d (delimiter) f column no file name

Head-> This command is used to print starting column of the data that
is to be entered. Syntax- head 2 file name

Tail-> This command is used to print last column of the data that is to
be entered Syntax- tail 2 file name

Cat -> To show the contents of more than one file


Syntax- cat file1, file2

Ps-> This command is used to get the list of all process that are
currently running.

Kill-> This command is used to delete a process.


Syntax- ps Kill pid

Tr(translate)-> This command is used to convert the alphabets from


capital to small letters or vice-versa. Syntax- tr [a-z] [A-Z] <file Command used to add two nos. Syntax- a=10 b=20 c= expr $a + $b echo $c echo $ HOME -> It returns name of home directory. echo $ LOGNAME -> It returns log in name echo $ PATH -> It specifies the path echo $ PS1(Prompt String)

Grep -> This command is used to return the no of rows which satisfy
the given condition. Syntax- grep condition file

Grep c -> This command is used to return the no of rows which


satisfies the condition. Syntax- grep c condition file

Grep v -> This command is used to return the rows which do not
satisfies the condition. Syntax- grep v condition file

Egrep-> This command is used to display the no of rows which


satisfies the two conditions. Example- egrep bca|bsc file

egrep c bca|bsc file

You might also like