What does it mean in Linux ? Part - 1


In Linux the syntax has special meaning. Some of them are given bellow:

# cat <file1> <file2> > <new file> --- To combine file1 and file2 into new file.

# cat <file> --- It show the content of the file . Cat command can be displayed only the text file.

# chown guru99 : guru99 test --- change user as guru99 and group as guru99 of test file at a time.

# rm <file> --- Delete file

# cat > <file> ---- Write content into this file. Then press Ctrl + D to come back to shell.

# chgrp root test --- Change groups as root of test file.

# chmod g+x test --- Add execute permission to the group for the test file.

# cp <source_file> <destination_file> --- Copy source file to destination file


# ls <ABC> <DEF> --- List the content of both directories <ABC> <DEF>

# ls ABC DEF > dirlist --- Standard output redirection to the dirlist


# cat sample | grep a --- Look for line containing the character a

# cat sample | grep ^a --- Look for the line which start with a.

# cat sample | grep t$ --- Look for the line which end with character.

# cat sample | grep –E p\{2} --- Look for the line where character  p appearing exactly two times one after the other. [as for example: apple]

# cat sample | grep “a\+ t” --- Look line where character a precede character t.

# ls ABC DEF > dirlist 2>&1 --- It will redirect error output to the standard output and standard output to the dirlist.


# echo {aaa, bbb, ccc, ddd} --- aaa bbb ccc ddd

# echo {a . . z} --- a b c d e f g h I j k l m n o p q r s t u v w x y z

# echo {1 . . 11} --- 1 2 3 4 5 6 7 8 9 10 11

# echo a{0 . . 9}b --- a0b a1b a2b a3b a4b a5b a6b a7b a8b a9b a10b


# lp –nc <filename>  --- Prints c copies of file

# lpr c <filename> --- Prints c copies of file

# lp –d <printer_name> <file_name> --- specify name of the printer

# lp –p <printer_name> <file_name> --- Specify name of the printer

# ps <PID_number> --- To know the status of the specific process


# pidof <process_name> --- To know the pid of the specific process

# mailx <address> <body> --- Command to send mail

# mv <source_file> <destination_file> --- Move (cut) source file to destination file 

# Chmod o=rwx test --- Set permission for other on tset file

# chmod u-r test --- Remove read permission to the user for the test file.

# mkdir /temp/music --- Create music directory under temp directory.

# rmdir <directory name> --- Remove directory and sub-directory of the directory.

# mkdir <dir1> <dir2> <dir3> --- Create multiple directory at a time.

# chmod <permission> <filename> --- This mean Change Mode. This command is used is set permission (read, write and execute) on a file/directory for the owner, group and the world. [Exmp. Chmod 764 test]

# mv <directoryname> <newdirectoryname> --- Move a file to a new location or rename it. Need to be superuser.

0 comments :

Post a Comment