Basic Commands
Basic Commands
Expy no:3
Date:27-2-2012
Roll No:312211105098
1.Display date command
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ date
Thur Mar 8 19:53:11 EST 2012
2.Display today's date in "Feb, 25, 2009" format
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ date +"%b,%d,%Y"
Mar,08,2012
3.Display today's time in "10:34:54" format
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ date +"%H:%M:%S"
19:14:12
5.Print the message "Welcome to CSE Dept" in normal and banner format
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ echo Welcome to CSE dept
Welcome to CSE dept
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ banner Welcome to CSE dept
# # #
# # #
# # #
# # #
# # #
## ##
#####
#
#
#
#
######
#
#### #
#
#
######
####
# #
# #
# #
# #
#
####
#
#
#
#
#
#
#
#
#
#
#### ## #
####
#
#
#
#
#
#
#
#
### #
#
#
# # ##
# ## #
#
#
#
#
#
#
######
#
#####
#
#
#######
####
##### #####
#
# #
#
#
#
#
#####
#
#
#
# #
#
##### #####
#######
#
#
#####
#
#
#######
#
#
#
#
#
#
19 20 21 22 23 24 25 17 18 19 20 21 22 23 21 22 23 24 25 26 27
26 27 28 29 30
24 25 26 27 28 29 30 28 29 30
31
July
August
September
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 3 4
1
1 2 3 4 5
5 6 7 8 9 10 11 2 3 4 5 6 7 8 6 7 8 9 10 11 12
12 13 14 15 6 17 18 9 10 11 12 13 14 15 13 14 15 6 17 18 19
19 20 21 22 23 24 25 6 17 18 19 20 21 22 20 21 22 23 24 25 26
26 27 28 29 30 31
23 24 25 26 27 28 29 27 28 29 30
30 31
October
November
December
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 3
1 2 3 4 5 6 7
1 2 3 4 5
4 5 6 7 8 9 10 8 9 10 11 12 13 14 6 7 8 9 10 11 12
11 12 13 14 15 6 17 15 6 17 18 19 20 21 13 14 15 6 17 18 19
18 19 20 21 22 23 24 22 23 24 25 26 27 28 20 21 22 23 24 25 26
25 26 27 28 29 30 31 29 30
27 28 29 30 31
10. Evaluate the expression (a+bc)*d/e+a/(++d) with the following values a=3, b=4, c=2,
d=1, e=10
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ bc -l
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
a=3
b=4
c=2
d=1
e=10
(a+b-c)*d/e+a/(++d)
2.00000000000000000000
11. Evaluate the expression a&&b||c , a<d&&a<c, a= =e
a&&b||c
1
a<d&&a<c
0
a==e
0
12. find the sine value for 30
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ bc -l
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
s(3.14/6)
.49977010264310239738
13. Print all the users logged in with heading
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ who -H
NAME LINE
TIME
COMMENT
1eeeb98 pts/1
2012-03-08 19:22 (:0)
14. Mention the file name from which 'who' command collects all the information
The file from which who command collects all the information is utmp. And the destination is
/var/run/utmp.
Office Phone
/dev/pts/2
23. Display the environment variables
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ env
SSH_AGENT_PID=1490
GPG_AGENT_INFO=/tmp/keyring-ZcAx5t/gpg:0:1
SHELL=/bin/bash
TERM=xterm
XDG_SESSION_COOKIE=4da2895f5f0f2a97e4a3d0100000004c-1331127595.272088475007774
WINDOWID=60817414
GNOME_KEYRING_CONTROL=/tmp/keyring-ZcAx5t
USER=1eeeb98
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=4
0;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar
=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31
:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:
*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=
01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:
*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.p
pm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=
01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2
v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:
*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.fl
c=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*
.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aa
c=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc
=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;
36:
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
SSH_AUTH_SOCK=/tmp/keyring-ZcAx5t/ssh
DEFAULTS_PATH=/usr/share/gconf/splc6~.default.path
SESSION_MANAGER=local/splc6~:@/tmp/.ICE-unix/1455,unix/splc6~:/tmp/.ICE-unix/1455
XDG_CONFIG_DIRS=/etc/xdg/xdg-splc6~:/etc/xdg
DESKTOP_SESSION=splc6~
PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ga
mes
PWD=/home/1eeeb98
LANG=en_US.UTF-8
GNOME_KEYRING_PID=1446
MANDATORY_PATH=/usr/share/gconf/splc6~.mandatory.path
COMPIZ_CONFIG_PROFILE=splc6~
splc6~_MENUPROXY=libappmenu.so
GDMSESSION=splc6~
HOME=/home/1eeeb98
SHLVL=2
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
IBUS_ENABLE_SYNC_MODE=1
LOGNAME=1eeeb98
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus2EFT85ZQV3,guid=29ea0abab8393d95c59082a40000006e
XDG_DATA_DIRS=/usr/share/splc6~:/usr/share/gnome:/usr/local/share/:/usr/share/
LESSOPEN=| /usr/bin/lesspipe %s
DISPLAY=:0
XDG_CURRENT_DESKTOP=Unity
LESSCLOSE=/usr/bin/lesspipe %s %s
XAUTHORITY=/home/1eeeb98/.Xauthority
COLORTERM=gnome-terminal
_=/usr/bin/env
24. Display the process status information
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ ps -m
PID TTY
TIME CMD
2700 pts/2 00:00:00 bash
-00:00:00 2814 pts/2 00:00:00 ps
-00:00:00 25. Display the process status information depends on memory usuage
#]0;1eeeb98@splc6~: ~#1eeeb98@splc6~:~$ ps
PID TTY
TIME CMD
2700 pts/2 00:00:00 bash
2815 pts/2 00:00:00 ps