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 #########################################################