Sie sind auf Seite 1von 5

Operating System

90220820382

LINUX COMMANDS
1)

MKDIR : This command is used for creating directory. SYNTAX : $ mkdir < dir name > CD : This command is for changing directory. SYNTAX : $ cd < dir name > PWD : This command is used for displaying the present working directory. SYNTAX : $ pwd TOUCH : This command create an empty file. SYNTAX : $ touch < file name >

2)

3)

4)

CAT : This command is used for creating, reading, writing, appending a file. SYNTAX : $ cat < file name > CAT > : This command is used to create a file. We can store data in this type of file unlike touch command. SYNTAX : $ cat > < filename >
5)

6)

CP : This command is used for copying a file from source to destination. SYNTAX : $ cp < source path > < destination path > MV : This command is used for moving a particular file from one memory location to other. This command can also be used for renaming the file. This command can also be used for overwriting a file.

7)

Operating System

90220820382

SYNTAX : $ mv < source path > < destination path >


8)

RM : This command is used for removing a file, directory, sub-directories. SYNTAX : $ rm < file name > < directory name >

RM i : This command is used for removing file interactively, i.e. before deleting files it would confirm it from user. SYNTAX : $ rm-I < dir name > 10) RMDIR : this command is used for removing directory but before removing the directory you must assure that the directory is empty i.e. there is no sub-directory or file in it. SYNTAX : $ rmdir < dir name> 11) LS : this command is used for displaying all the files and sub-directories of present working directories. SYNTAX : $ ls Ls-a : display all hidden files of present working directory. Ls-l : display long list of files and sub-directories of present working directories.
9)

12)

MAN : This command is used for displaying full descriptions of any command. SYNTAX : $ man < command name > WILD CARDS : Wild cards are used for special purpose in addition with other commands. E.g. we use * for displaying files starting with a particular character. UMASK : this command display the by default permission of the file i.e. the by default mode of file. SYNTAX : $ umask CHMOD : This command is used for changing mode

13)

14)

15)

Operating System

90220820382

of the file (we have three types of mode read = 4, write = 2, and execute = 1 and by default mode of any file is read only so we have to change the mode file before writing any thing into the file and if the file is a program then before executing the program you have to change the mode of file to execution mode.) SYNTAX : $ chmod < mode > < file name >
16)

LOGNAME : This command is used for displaying the login name. SYNTAX : $ logname UNAME : This command is used for displaying the version of the linux. SYNTAX : $ uname PASSWD : This command is used for changing password of current user. SYNTAX : $ passwd WHO : This command displays the number, nmes and other details of the connected dumb terminals. SYNTAX : $ who WHO AM I : This command is used for showing the details of your own terminal. SYNTAX : $ whoami

17)

18)

19)

20)

LN : This command is used for creating symbolic links of file. Symbolic link is the reference to a file with a different name in any other location. SYNTAX : $ ln < source path > < destination path > < new file name >
21)

Operating System

90220820382

WC : This command is used for displaying the number of lines, sentences, words & characters in a file. SYNTAX : $ wc < file name > wc l file1 .txt ( display the no. of lines only ) wc w file1 .txt( display the no. of words only ) wc c file1 .txt ( display the no. of characters only ) wc .file1 .txt ( display the details of the hidden file ) wc a* (display the details of all the files starting with character a)
22) 23)

CAL : This command is used for displaying calendar. SYNTAX : $ cal < month > < year > cal ( display the calendar of the current year ) cal 10 1999 ( display the calendar of October 1999 )

24)

CMP : This command is used for comparing two files. SYNTAX : $ cmp < first file name > < second file name >

25)

FILE *: This command is used for displaying the type of the files (e.g. file1 .txt, io.sys ) SYNTAX : $ file* LP : This command is used for printing. SYNTAX : $ lp < file name >

26)

27)

MORE : This command is used for displaying the contents of a file page-wise. SYNTAX : $ more < file name > GREP : ( GREP stands for Global search for a Regular Expression and Print )

28)

Operating System

90220820382

SYNTAX : $ grep < option > < element to be searched > <file name > grep i hello file1 .txt ( search for hello case sensitively ) grep in hello file1 .txt ( display line number also ) grep ie hello file1 .txt ( display the number of times the hello appears in the file1 .txt ) grep [ h H ] file1 .txt ( here search for hello which can start with h or H ) 29) PS : This command is used to display the details of the active processes of the operating system. SYNTAX : $ ps < option > ps a ( show the details of processes of all users ) ps u ( show the details of the processes of specified users ) ps e ( show the details of the processes started by users ) 31) CAT : This command is used to display the contents of a file which already exists. SYNTAX : $ cat < file name >

Das könnte Ihnen auch gefallen