Saturday, November 7, 2009

Commands by Example in Unix

1. split -l 5000 -a 3 (-d) theFile newFile

2. egrep -v -f subFile orgFile

3. echo xxx | tee -a /home/test.log

4. Shell example - it works with bourne shell (ie, sh), but not tcsh

PHILLY$for s in `ls -1 /home/hosts/`; do
> echo $s
> ssh $s "ls /opt/lib/defaults/license.6.0"
> done

5. grep xxx XXX | awk '$2 == 1 { ++total }; END {print "total = ", total} '

6. setenv LOG_FILE /bbb/ccc

No comments: