You are on page 1of 14

PRACTICAL 1

1.
Type 1
Calendar
Syntax: Cal
Description: It display the calendar of current month
OUTPUT

Type 2
Syntax: Cal 01 2015
Description: It display the calendar of specified month

OUTPUT
Type 3
Syntax: Cal 2015
Description: It display the whole current calendar

OUTPUT

2.
Date
Syntax: date
Description: It displays the current date of system

OUTPUT
Type 2
Syntax: date +%M
Description: It displays current month in numeric format.

OUTPUT

Type 3
Syntax: date +%H
Description It displays current month in alphabetic format.

OUTPUT

3.
BC
Syntax: BC
Description: It is used for arethmetic operations and it performs only integer computation
and decimal
OUTPUT

Type 2
Syntax: BC
SCALE=2
Description: to enable flotation point computation , sets scale to number of digits of decision.

OUTPUT

4.
Who
Syntax: who
Description: this shows the current users of the system
OUTPUT
5) Whoami
Syntax: whoami
Description: this shows the current login client name

OUTPUT

6.
Uname
Syntax:uname
Description: it displays the username

OUTPUT

Type 2
Syntax: UNAME -R
Description: It displays verision of os.
OUTPUT

Type 3
Syntax: UNAME -N
Description: It displays hostname

OUTPUT

7.
W
Syntax: W
Description: It displays the info of user who logged in and what they doing.

OUTPUT
Type 2
Syntax: W -H
Description: To remove header from the output.

OUTPUT

8.
Hostname
Syntax: hostname
Description: it displays the details of host

OUTPUT

Type 2
Syntax: HOSTNAME -D
Description: Used to display domain name.
OUTPUT

9. PS
Syntax: PS
Description: It is used to view the process running on the terminal.

OUTPUT

10. LS
Syntax: LS
Description: It list all the filename of current working directory.

OUTPUT

Type 2
Syntax: LS -L
Description: It list all the filename of current working directory with some attributes.

OUTPUT

11. Echo
Syntax: echo text
Description: This command display the text on the standard output

OUTPUT

12. Printf
Syntax: PRINTF
Description: It is used to display output on the screen.

OUTPUT
13. Clear
Syntax: CLEAR
Description: It is used to clear the terminal window.

OUTPUT
PRACTICAL 2
1. INFO CAL
Syntax: INFO CALL
Description: It gives detailed info of the command.

OUTPUT

2. HELP CAL
Syntax: HELP CAL
Description: It provides the following information i.e. name,synopsis,description,options that
are available for the command.

OUTPUT
Type 2
HELP –D CAL
Syntax: Help –d cal
Description: This displays short description of the command.

OUTPUT

3. WHAT IS DATE
Syntax: WHATIS DATE
Description: It gives the single line descriptionof the command .

OUTPUT

4. MAN DATE
Syntax: MAN DATE
Description: It displays the mannual page of the given command
OUTPUT

Type 2
Syntax: MAN -F DATE
Description: It displays the mannual page of the given command

OUTPUT

5. ODD EVEN
Code:
echo "Enter the number"
read a
c=`expr $a % 2`
if [ $c -eq 0 ]
then
echo "EVEN"
else
echo "ODD"
fi

OUTPUT

6. LARGEST INTEGER
Code:
echo "Enter three integers:"
read a b c
if [ $a -gt $b -a $a -gt $c ]
then
echo "$a is Greatest"
elif [ $b -gt $c -a $b -gt $a ]
then
echo "$b is Greatest"
else
echo "$c is Greatest"
fi

OUTPUT

You might also like