Thursday, July 21, 2011

Unix command

Some commands I had used on linux / unix / aix terminal.
I often used these in the past but slowly forgotten as it long time untouched.
..and now I have to dig it again, yeah in needed now.
So, I am going to write here. To ease some lowly hazed memory of me.

get a line of words in a file:
grep "RESPONSE" -f "uip.log.1"
grep pattern_text -f file_name_pattern. Options -f is for type of file -d for directory

find some files and get lines which contains respectable pattern_text
find /abcd/web/log/uip -name "abc.log*" -mtime +1 -mtime -2 | xargs grep "RESPONSE"
find directory_entry, Options -name is pattern_file_name.
a bit complicated way using pipe(ing) to further process some 'finding' (duh!) using xargs to grep line contain pattern_text.
xargs is argument passed in unix shell.

other commands and i'm too lazy to contribute some description :P
ls -l
rm -rf
pushd
popd
whoami
hostname
traceroute
ifconfig

...