![]() |
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 |
| Counting files in a directory that match a pattern | dsravan | Shell Programming and Scripting | 31 | 07-24-2006 12:12 PM |
| search all files for a pattern | ynaik002 | UNIX for Dummies Questions & Answers | 4 | 02-23-2006 03:51 PM |
| Search file for pattern and grab some lines before pattern | frustrated1 | Shell Programming and Scripting | 2 | 12-22-2005 03:41 PM |
| List files that do not match the search pattern | olapxpert | UNIX for Dummies Questions & Answers | 7 | 04-14-2005 04:49 PM |
| List files that do not match the search pattern | olapxpert | IP Networking | 1 | 04-14-2005 03:37 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
search files which doesnot match pattern ?
Hi
I need a command to search files in a directory which does not match with pattern .. Plz send me this Ex : Test is directory and has some 10 files with different name all are with *.dat extension , need to search files which doesnot contain word "Dummy file". Thanks |
|
||||
|
Quote:
Code:
find . -name "*.dat" | xargs grep -v "Dummy file" |
|
||||
|
That will just display all lines in all files that do not contain "Dummy file".
Try this instead: Code:
# list files that *do* contain "Dummy file" and save in a file grep -l "Dummy file" * > /tmp/matches # use that file to exclude them from the list of files ls | grep -xvf /tmp/matches |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|