UNIX COMMANDS
By
Dilipa T M
3rd BCA
Regno-15B51409
TYPES OF UNIX COMMANDS:
General purpose Commands
echo [option]….[string]…
Used in shell scripts to display messages on the
terminal, or to issue prompts for taking input from
the user. It can also used to display shell variables.
4. printf – FORMATED OUTPUT
Syntax :
printf “format_string”
Its an alternative to echo and used to write formatted
output.
Except in the BASH shell, printf command is an
external command.
The command can be used the same way as echo.
5. tput – RESPOSITIONING THE CURSOR.
Syntax :
$tput option
tput has some useful functions that help in
positioning the cursor at specific location pr for
highlighting your text.
6. bc – THE CALCULATOR
The bc command is less friendly, extremely
powerful command to perform accurate
calculations.
7. passwd – CHANGING THE PASSWORD
Syntax :
passwd
The passwd command is used to change
password.
8. tty – TERMINAL DETAILS
Syntax : $ tty
5. rmdir-(Removing directories)
The rmdir command removes one or more directories
or sub-directories.
When directories are removed, care should be taken to
remove them from lower to higher level. Further
directories can be removed only when they are empty.
Syntax:
1) PID :is short form of process ID, a number which uniquely identifies the
process on the system.
3) TIME: field displays the total amount of CPU time , the process has used.
4) CMD :field shows the name of the command associated with the process.
FILE RELATED COMMANDS
1. cat command : To display the contents of a
text file on the screen use cat(concatenation)
command.
$cat sample – Displays the contents of a
sample file.
$cat>rhyme
^d
* This command will create a text file rhyme
with the text typed.
* The ^d(ctrl + d) typed on a new line will
signal the end of the user input.
$cat>>rhyme
up above the world so high
likw a dimond in the sky.
^d
*This command will append the typed text to the
existing rhyme file.
$cat data1 data2
$rm file1
* This command deletes the file1.
4. mv command : To change the name of a
file.(rename).
Syntax :
$wc file1
8 46 125 file1
lines words chars
nohup Command:
top Command:
Syntax:
$nice -10 cat test.dat
Syntax:
$nice --10 cat test.dat
time Command: