You are on page 1of 2

1).

The Calendar ------------$ cal [ [month] year] Eg: $ cal $ cal 03 2006 --> Displays the current month --> To see the calendar month of March 2006

2). Date ----we can display the current date by using date command. Eg: $date The command can also be used with suitable format specifiers arguments. Each format is preceded by the + symbol, follwed by by the % operator,and a single character describing the format Eg: Suppose assume that, this is august month $date +%m --> This will show "08" $date +%h --> This wil show month name " Aug " $date +"%h %m" --> This will show both like " Aug 08 " $date +%D --> mm/dd/yy $date +%d --> 30 $date +%a -->Sat $date +%A --> Saturday $date +%h --> aug $date +%y -->08 $date +%Y --> 2008 $date +%m --> 08 (months it will give) $date +%T --> HH:MI:SS $date +%H --> HH $date +%M --> Mi $date +%S --> SS $date +"%D %T" 3). Change Password ---------------$passwd 4). awk $ awk '/OHIN/' <filename> > test.xt ( Search for OHIN records and write to test.txt) 5) tee --> The tee command transcribes the standard input to the standard output and makes copies in the files. Eg: ls -lrt |tee no_lines|wc -l

file:///C|/Documents%20and%20Settings/polachan/Desktop/Unix%20Commnads.txt[6/11/2010 6:44:21 AM]

Note: So by the tee command we can also create files. 6) sort --> Sort is used to sort data in the files. eg: $sort sortfile -> Here sortfile is file which contains data with | delimiter,default it will sort the file on first column. $sort +1 -t "|" sortfile --> sort on second column or $sort -k2 -t "|" sortfile --> sort on second column $sort -r -k2 -t "|" sortfile --> In Reverse order $sort +1 +2 -t "|" sortfile > sort on more than one column 7) Grep --> search a file for a pattern eg: $grep -i a <file_name> --> ignore the case sensitive, output both capital and smaller case or $grep -i "a" <file_name> $grep -vi a <file_name> --> It works like "not in " funtion in Oracle $grep -n a <file_name> --> It will give the output with numbers $grep -ci a <file_name> --> It will give o/p as no of "a"s (count) 8) Cut --> cut out (extract) selected fields of each line of a file Eg: $cut -f 9 -d "|" 9) mailx sreenath.polachandra@hp.com < ss --> ss is a file here mailx -r sreenath.polachandra@hp.com -s "file is processed" < ss 10) sed --> Stream editor eg: sed -e `s/Bangalore/Benguluru/g` file_nm1 file_nm2 e--> edit s--> substitute g--> globally 11) How to kill the processors, which all are running? $kill `ps -ef |cut -f 2 -d ' '` $kill `ps -ef|grep informatica|cut -d' ' -f5`

file:///C|/Documents%20and%20Settings/polachan/Desktop/Unix%20Commnads.txt[6/11/2010 6:44:21 AM]

You might also like