Linux FIND command, exclude several path, where most files?

P

postcd

Guest
Hello,

im doing regular search in files contents in around 25 linux file systems (mostly redhat, debian).,

i want to lower load on server by excluding folders which contains only system files and alot of files

Which linux folders contains most files?

I found i can exclude folders like this:

find . -type f -name "*searched phrasse*" ! -path "./tmp/*" ! -path "./var/log/*"

the linux will entirelly skip above excluded directories, or it will go into them and search, but only mute listing? thx

i mainly want to relieve disk I/O operations, thats also why i added "/bin/nice -n 19 " before the find command
 


Might work better if you start your search where you thing the files might be. For example, user files, use

Code:
find ~ -name "name_to_find"
 
Try

Code:
find . -path ./proc -prune -or -path ./sys -prune -or -path ./run -prune  -or -iname '*start*' -print
 
Last edited:

Staff online

Members online


Latest posts

Top