Results 1 to 3 of 3
Hi all,
I am trying to find all files older than 15 days with extensions other than gz, for some reason the find I have does not have regextype switch, ...
- 12-09-2008 #1Just Joined!
- Join Date
- Nov 2008
- Posts
- 11
[SOLVED] find regex
Hi all,
I am trying to find all files older than 15 days with extensions other than gz, for some reason the find I have does not have regextype switch, please advise regex that will do it
obviously did not work as by default find uses emacs regexes which use ^ for beginning of line. Your help much appreciated!Code:find . -type f -regex .*.^gz -mtime +15
SuSE Linux, 2.6.5-7.312
- 12-09-2008 #2Linux Newbie
- Join Date
- Jul 2008
- Posts
- 181
I don't quite see what your regular expression is supposed to match, and you should definitely use quotes as well. I assume you are looking for files that do not have the "extension" ".gz". In that case, you don't even need regular expressions. A simple
will do.Code:-not -name "*.gz"
- 12-09-2008 #3Just Joined!
- Join Date
- Nov 2008
- Posts
- 11
Thanks very much, it worked! Quoted the name in the script, thanks for the hint.


