UNIX Lab File - A50105221081
UNIX Lab File - A50105221081
Page
S.No. Topic Practical Signature
No.
Unix
1. Unix Commands 1-15
Commands
pwd command
Theory: This command prints the full pathname of the current working
directory.
Output:
cd command
Output:
ls command
Theory: This command lists the files and directories under current working
directory.
Output:
rm command
Theory: This command is used to remove/delete the file from the directory.
Output:
mv command
Theory: This command is short for move. It is used to move/rename file from
one directory to another. mv command is different from cp command as it
completely removes the file from the source and moves to the directory
specified, where cp command just copies the content from one file to another.
Output:
cat command
Theory: This command is used to create a new file and to display the contents
of already existing file.
Syntax:
Output:
cmp command
Theory: cmp command compares two files and tells you which line numbers are
different.
Output:
cp command
Theory: This command copies files from one location to another. If the
destination is an existing file, then the file is overwritten; if the destination is an
existing directory, the file is copied into the directory (the directory is not
overwritten).
Output:
bc command
Syntax: bc [options]
Output:
echo command
Theory: This command prints the given input string to standard output.
Output:
mkdir command
Output:
paste command
Theory: This command is used to paste the content from one file to another
file. It is also used to set column format for each line.
Output:
rmdir command
Output:
wc command
Theory: This command counts the characters, words or lines in a file depending
upon the option.
Syntax: wc [options] filename
Output:
cal command
Theory: This command will print the calendar of current month by default.
Output:
clear command
Theory: This command clears the screen and puts cursor at beginning of first
line.
Syntax: clear
Output:
tty command
Theory: This command prints the file name of the terminal connected to
standard input.
Output:
banner command
who command
Theory: This command tells you who's logged on, and where they're coming
from. Useful if you're looking for someone who's actually physically in the same
building as you, or in some other particular location.
Syntax: who
Output:
date command
Theory: This command prints or sets the system date and time.
Output:
chmod command
Theory: This command will give all permissions to the owner (i.e read, write
and execute) while read and execute permissions only to others and group.
Output:
touch command
Output:
uname command
Output:
ps command
Syntax: ps [options]
Output:
exit command
Syntax: ps [options]
Theory:
Syntax:
vi filename
Command Mode:
Input Mode:
Line Mode:
PRACTICAL NO. 27
Write a shell script to perform addition of two numbers.
PRACTICAL NO. 28
Write a shell script to perform subtraction of two numbers.
PRACTICAL NO. 30
Write a shell script to perform division of two numbers.
PRACTICAL NO. 32
Write a shell script to swap two numbers using third variable.
PRACTICAL NO. 34
Write a shell script to print the table of a number.