Results 1 to 6 of 6
Usually, when we look for a file named, "abc.gz", the command will be:
find -name "abc.gz"
But how to find all files which is not named as "abc.gz"?...
- 02-12-2009 #1Just Joined!
- Join Date
- Feb 2009
- Posts
- 4
What command to find files that not meeting some conditions?
Usually, when we look for a file named, "abc.gz", the command will be:
find -name "abc.gz"
But how to find all files which is not named as "abc.gz"?
- 02-13-2009 #2Linux Newbie
- Join Date
- Sep 2007
- Posts
- 159
hi kenny,
the exclamation mark "!" negates expressions. it's in the man page under "operators".
cheers, kai
- 02-13-2009 #3Just Joined!
- Join Date
- Feb 2009
- Posts
- 4
- 02-13-2009 #4Linux Newbie
- Join Date
- Sep 2007
- Posts
- 159
note the blank between ! and -nameCode:find ! -name "abc.gz"
- 02-14-2009 #5Just Joined!
- Join Date
- Feb 2009
- Posts
- 4
- 03-05-2009 #6
You can also use the following way for better readability.
find -not -name "abc.tgz"
The technique which you are asking is called as inverting match. You can find a lot of examples over here... Mommy, I found it! — 15 Practical Linux Find Command Examples


Reply With Quote

