grep in action
example:
ls -alR | grep -v bak | grep -v gz | grep -v log.Z | grep -v .tar | grep -v bak.Z | tee ~/listing.txt
#########################################################
to extract ONLY pertinent (imo) data from a listing of mulitple
files... (directories all had a 0 in them, wanted to eliminate the . and ..
directories (although I could have done that using ls -Al), links, lost+found
and the "total" info...)
ls -al *0* | grep -v total | grep -v lrwxr | grep -v lost | grep -v '\.' | more
this could also have been piped to a file, replace more with: | tee -a /tmp/filelist
#########################################################
ok, so now I want to just show the first field and the ninth field,
but ONLY when the first field is NOT drwx:
cat /tmp/filelist | awk '{if ($1 ~ /^drwx/ ){ print $1 " "$9}}' | tee -a /tmp/list
#########################################################
grep "http://www.somedomain.com/family" *.htm*
perl -pi -e s'$"http://www.somedomain.com/family"$"http://anotherdomain.com/BIBLE"$g' *.html
grep "http://anotherdomain.com/BIBLE" *.html
find ./web -type f -name *.htm* -print
find ./web -type f -name *.htm* -exec ls {} \;
find ./web -type f -name *.htm*
-exec perl -pi -e s'$"http://www.somedomain.com/family"$"http://anotherdomain.com/BIBLE"$g' {} \;
|