1 - Basic Shell Commands
1 - Basic Shell Commands
1.DATE:
$ date
Sat Mar 24 14:45:59 IST 2016
$ date +%m
03
$ date +%h
Mar
$ date +%d
24
$ date +%y
16
$ date +%H
14
$ date +%M
46
$ date +%s
1332580616
$ date +%a
Sat
$ date +%A
Saturday
$ date +%Y
2016
2.ECHO:
$ echo hai
hai
$ echo '"University Exam"'
"University Exam"
3.CALENDAR:
$ cal
March 2012
Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
$ cal 01 2012
January 2012
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
4.CALCULATOR:
$ bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
8+9+4
21
5.WHO:
$ who
cs11001 pts/1 2012-03-24 14:45 (10.0.4.54)
6.WHO AM I:
$ who am i
cs11001 pts/1 2012-03-24 14:45 (10.0.4.54)
7.FINGER:
$ finger cs11001
Login: cs11001 Name: cs11001
Directory: /home/cs11001 Shell: /bin/bash
On since Sat Mar 24 14:45 (IST) on pts/1 from 10.0.4.54
No mail.
No Plan.
8.ID:
$ id
uid=583(cs11001) gid=583(cs11001) groups=583(cs11001) context=unconfined_u:syste
m_r:unconfined_t:s0
9.TTY:
$ tty
/dev/pts/1
10.MAN:
$ man echo
ECHO(1) User Commands ECHO(1)
NAME
echo - display a line of text
SYNOPSIS
echo [OPTION]... [STRING]...
DESCRIPTION
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version
output version information and exit
If -e is in effect, the following sequences are recognized:
\0NNN the character whose ASCII code is NNN (octal)
\\ backslash
\a alert (BEL)
\b backspace
\c suppress trailing newline
\f form feed
\n new line
\r carriage return
\t horizontal tab
\v vertical tab
11.SEMI-COLON OPERATOR:
$ date;echo welcome;tty
Sat Mar 24 14:50:54 IST 2012
welcome
/dev/pts/1
12.&& OPERATOR:
$ banner && date
-bash: banner: command not found
13.|| OPERATOR:
$ banner || date
-bash: banner: command not found
Sat Mar 24 14:51:21 IST 2012
14. HISTORY:
$ history
chmod u=r computer
cat>>computer
cat computer
chmod u=w computer
cat>>computer
chmod u=r+w computer
cat computer
cat>>computer
history
15. CLEAR THE SCREEN:
$ clear
16. DISPLAY COMPLETE PATH OF WORKING DIRECTORY:
$echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/cs12001/bin