Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
as you see im trying to exclude folders like "proc" and "task" from the search, but when i execute script, it returns things like:
Quote:
find: /vz/root/240/proc/15889/task/15976: No such file or directory
find: /vz/root/240/proc/15889/task/16070: No such file or directory
find: /vz/root/240/proc/15889/task/16092: No such file or directory
find: /vz/root/240/proc/15889/task/16105: No such file or directory
find: /vz/root/1140/proc/1/task/1: No such file or directory
find: /vz/root/1140/proc/1170/task/1170: No such file or directory
find: /vz/root/1140/proc/1437/task/1437: No such file or directory
But when i exclude "sys" folder same way as proc, it woks to be excluded, but proc still showup
thx, but kindly please tell me why find dont skip that folders. my aim is to decrease server load by skipping that folders, how i can make find to skip folder and dont waste time by working with it?
Ah. If you want to actually 'ignore' the directories and everything under it, you'll need to use 'prune' as find is not smart enough to NOT delve into an ignored directory.
Thanks for an advice, i modiffied the command to contain "-prune" instead, please is this correct?
the command should output last 24 hours modiffied files containing $phrasse into file $outputfile ..
I believe prune is more of an action, like -print is. So it comes after what you want to prune. For example:
Quote:
find [path] [stuff to prune] -prune
Quote:
find / -type d -path "/proc" -prune
I'm not sure that you need as many pattern matches either, with the *word*. But of course I don't know your file system, or the exact purpose of your find. But I say, use what was discussed here, play around with the output and see if it meets your needs. I also would say to many try a few conditions manually, make sure they do what you want, then tie them together into your script.
If you had thought about the information provided in your other thread http://www.linuxquestions.org/questi...es-4175515772/
then you might have realised that you will do better by grouping what you want to prune into a single expression
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.