![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| find command with exec doesnt work | funtochat2002 | Shell Programming and Scripting | 6 | 07-26-2006 02:29 PM |
| Find command with prune and exec options | Sebarry | UNIX for Dummies Questions & Answers | 2 | 06-19-2006 04:07 AM |
| Find command with prune and exec | Sebarry | UNIX for Advanced & Expert Users | 1 | 06-18-2006 01:43 PM |
| find command exec error | pavan_test | UNIX for Dummies Questions & Answers | 2 | 06-13-2006 03:58 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
find command with -exec
Hi People,
I have a directory full of compressed files (.Z extention) In many of these files there is a string pattern (3800078163033) I want to find all file names which contain this string in their text. Regards, Abhishek |
|
||||
|
Do you mean in the filename itself or within the actual compress file?
If you mean just the filename then :- Code:
find *3800078163033*.Z 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
|
|
||||
|
Thanks Lavascript...I wnated the 2nd solution and it Worked!!!
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|