Sunday, March 1, 2015

BASIC COMMANDS - Unix

General commands
Command                 Function
date                 Used to display the current system date and time.
date                +%D Displays date only
date                +%T Displays time only
date               +% Y Displays the year part of date
date               +% H Displays the hour part of time
cal                 Calendar of the current month
cal year           Displays calendar for all months of the specified year
cal month year Displays calendar for the specified month of the year
who               Login details of all users such as their IP, Terminal No, User name,
who am i        Used to display the login details of the user
tty                   Used to display the terminal name
uname           Displays the Operating System
uname –r        Shows version number of the OS (kernel).
uname –n           Displays domain name of the server
echo "txt"          Displays the given text on the screen
echo $HOME       Displays the user's home directory
bc Basic calculator. Press Ctrl+d to quit
lp file                     Allows the user to spool a job along with others in a print queue.
man cmdname         Manual for the given command. Press q to exit
history              To display the commands used by the user since log on.
exit                       Exit from a process. If shell is the only process then logs out

Directory commands

Command                              Function
pwd                                Path of the present working directory
mkdir dir                        A directory is created in the given name under the current directory
mkdir dir1 dir2              A number of sub-directories can be created under one stroke
cd subdir                    Change Directory. If the subdir starts with / then path starts from
root (absolute)                 otherwise from current working directory.
cd                                 To switch to the home directory.

cd /                              To switch to the root directory.
cd ..                               To move back to the parent directory
rmdir subdir                      Removes an empty sub-directory.

No comments:

Post a Comment