Tuesday 10 October 2017

Unix and Linux Basic Commands



Below are details of Basic Commands


CommandDescription
datedate command is used to print or set the system date and time. Syntax: date options
calcal displays a simple calendar. If arguments are not specified, the current month is displayed. Syntax: cal options
clearclear the terminal screen
pwdpwd command is used to print name of working directory
unameprint system information. Generally used to know the flavor and version of the
operating system
whoshow who is logged on
uptimeTell how long the system has been running.
lsIf you simply execute ls on the command prompt, then it will display the files
and directories in the current directory.You can pass a directory as an argument
to ls command. In this case, the ls command prints all the files and directories in
the specific directory you have passed.Syntax: ls directory
touchThe touch command simply creates an empty file. The below touch command
creates a file_name.txt in the current directory.Syntax: touch file_name.txt
catThe cat command is used to display the contents in a file.
Syntax: cat file_name.txt
headThe head command can be used to print the specified number of lines from the
starting of a file. Syntax: head -3 file_name.txt
tailThe tail command can be used to print the specified number of lines from the end
of a file. Syntax: tail -3 file_name.txt
mkdirThe mkdir command is used to create the specified directory.
cdThe cd command can be used to change from one directory to another directory.
You need to specify the target directory where you want to go.
mvThe mv command is used to rename the files and it also used for moving the files
from one directory into another directory.
cpThe cp command is used to copy the content of source file into the target file.
If the target file already have data, then it will be overwritten.
rmdirremove or delete directories. Syntax: rmdir directory_name
wcwc command can be used to find the number of line, words and characters
in a file.
cutcut remove sections from each line of files. Syntax: cat new_file.txt|cut -c1
manIf you want to know more about all above command then go to man comman Syntaxman command_name.

No comments:

Post a Comment