LINUX Commands

You might also like

Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 2

1

LINUX Commands

To create a directory eg: mkdir Intel To remove the created directory Eg: rmdir Intel To create a text file Eg: echo janaki.txt To create a directory and move the text file to the directory. Eg: mkdir janaki mv janaki.txt janaki To view the results after moving. Eg: ls -R ( this will display the list of directories with the files in the particular directory). To move multiple files to a directory Eg: mv a.txt b.txt c.txt janaki To view the list of files and directories Eg: ls can also use another command Eg: ls | more ( this command will display the list of all the directories in order(one below the other). To get back to the prompt Eg: ctrl + c ( this will get back to the prompt).

MV command is used to move the file . It only moves the source file to the destination but not duplicate it.

To clear the screen Eg: clear To go to the other user (psuedo user) Eg: su To copy a file to a directory Eg: cp a.txt gayatri

GREP : Global / regular / expression / print . This is a command line text search utility written originally for UNIX The name comes from the ed editor command. Eg : grep apple fruitlist.txt In this case, grep prints all the lines containing apple in the fruitlist file.There fore lines with apple which may be pineapple or custard apple are all printed regardless of the word boundaries.

2 To record a session Eg: script If you dont specifically save any file name, it will be stored in file name typescript. To change the user password Eg: passwd Current Password Enter New Password Re-type New Password To know who all logged on to the system Eg: who This will display who all logged on to the system. To concatenate files Eg: cat To concatenate files in reverse Eg: tac More and Less commands are used to view large files one page at a time. Wc command is used to get the word count in a file. Eg : wc a.txt To zip a file Eg : gzip a.txt To unzip a file. Eg : gunzip a.txt To open a directory Eg : cd /tmp

You might also like