The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-23-2009
lavascript lavascript is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 47
Do you mean in the filename itself or within the actual compress file?

If you mean just the filename then :-


Code:
find *3800078163033*.Z

should work.

If you mean within the file then i'm not sure if there's an equivalent as below for files compressed with compress but if they were gzipped or bzipped there is bzcat and gzcat so you could do :-


Code:

string="3800078163033"

for file *.Z
do
   if [[ -n "$(gzcat $file | grep $string)" ]];then
       echo "File [$file] contains string [$string]"
   fi
done