Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding files and omitting certain ones 1

Status
Not open for further replies.

ksbrace

Programmer
May 13, 2000
501
US
hello,
I'm trying to find some files based on the date, but I also would like to omit some of them. I have the find command part correct, but I would like to be able to omit certain files. Thanks in advance,
Kelly


Code:
find ./ -type f –mtime 14 > new_files


 
omit certain files
What are the rules ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
let's say omit .log, .pid files or maybe files in a directory called scratch. Sorry for the lack of info in the previous post.

 
Two starting points:
find ./ -type f –mtime 14 ! -name '*.log' ! -name '*.pid' > new_files

find ./ -type f –mtime 14 | egrep -v '\.pid$|\.log$|/scratch/' > new_files

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top