Page 1 of 3

FIND

Posted: Fri May 23, 2014 9:28 am
by briandc
Every now and then I can hear my pc processing even when I'm not doing anything. I ran "top" and found an app called "find" was using 10-15% cpu. I tried to kill the process (the PID) but nothing happened, it kept on working. Is this normal? Why was it running and what for? Is it a necessary app?

Thanks!

brian

Re: FIND

Posted: Fri May 23, 2014 10:14 am
by raboof
briandc wrote:Every now and then I can hear my pc processing even when I'm not doing anything. I ran "top" and found an app called "find" was using 10-15% cpu. I tried to kill the process (the PID) but nothing happened, it kept on working. Is this normal? Why was it running and what for? Is it a necessary app?
Check who started it with 'ps faux | less'.

Perhaps part of the 'updatedb' process for the 'locate' database?

Re: FIND

Posted: Fri May 23, 2014 11:28 am
by briandc
raboof wrote:
briandc wrote:Every now and then I can hear my pc processing even when I'm not doing anything. I ran "top" and found an app called "find" was using 10-15% cpu. I tried to kill the process (the PID) but nothing happened, it kept on working. Is this normal? Why was it running and what for? Is it a necessary app?
Check who started it with 'ps faux | less'.

Perhaps part of the 'updatedb' process for the 'locate' database?
I can do the command, but I had just turned the pc on. (I'm the only one using it.)
That's why I can't figure out: a) why it runs by itself, and b) if it's a normal behavior.

brian

PS: If it's any help, the owner of the process was "nobody."

Re: FIND

Posted: Fri May 23, 2014 11:45 am
by raboof
briandc wrote:That's why I can't figure out: a) why it runs by itself
It's probably run (perhaps indirectly) from a crontab.
briandc wrote:b) if it's a normal behavior.
Probably, but it might still be interesting what exactly it is, and perhaps you don't want/need it.

Re: FIND

Posted: Fri May 23, 2014 12:30 pm
by briandc
Yes, I suppose I could just uninstall it. I usually use "locate" to find files rather than "find" anyway. :)

If anyone has more details about this app, I'd be curious to know why it behaves this way. It was certainly slowing things down. (It always stops after a few minutes. Perhaps there is some type of default setting that's making it run, but I don't recall ever activating it.)


brian

Re: FIND

Posted: Fri May 23, 2014 1:17 pm
by raboof
briandc wrote:Yes, I suppose I could just uninstall it. I usually use "locate" to find files rather than "find" anyway. :)
You don't want to remove the 'find' utility, it is a general tool - many scripts will break when you delete it. If you want to remove anything, you want to remove the process that is calling find.

Re: FIND

Posted: Fri May 23, 2014 1:33 pm
by briandc
raboof wrote:
briandc wrote:Yes, I suppose I could just uninstall it. I usually use "locate" to find files rather than "find" anyway. :)
You don't want to remove the 'find' utility, it is a general tool - many scripts will break when you delete it. If you want to remove anything, you want to remove the process that is calling find.
Yes, in fact I have now learned that "find" is part of the "findutils" package and when using synaptic to remove it there was a prompt warning me that removing it might "make my system unusable." :shock: (something almost "Windows-like"... :? )

As far as I can tell, this "find" app runs at start-up. However, I don't know how to pinpoint exactly which app is causing it to run.

From gnu.org:
It is common for the operating system to periodically invoke find for self-maintenance purposes.
http://www.gnu.org/software/findutils/m ... iderations

brian

Re: FIND

Posted: Fri May 23, 2014 2:12 pm
by raboof
briandc wrote:As far as I can tell, this "find" app runs at start-up. However, I don't know how to pinpoint exactly which app is causing it to run.
'find' is not an application that does something useful in and of itself, it is a tool you can use when writing other scripts. You can think of it as 'an advanced version of ls': you wouldn't want to remove 'ls' from your system either, even when it can be invoked in a way that causes I/O (i.e. 'ls -R /').

Re: FIND

Posted: Fri May 23, 2014 2:58 pm
by briandc
raboof wrote: 'find' is not an application that does something useful in and of itself, it is a tool you can use when writing other scripts. You can think of it as 'an advanced version of ls': you wouldn't want to remove 'ls' from your system either, even when it can be invoked in a way that causes I/O (i.e. 'ls -R /').
So what applications would envoke it at startup, and why? It seems quite strange..


brian

Re: FIND

Posted: Fri May 23, 2014 5:07 pm
by heix
briandc wrote:So what applications would envoke it at startup, and why? It seems quite strange..
If you know your way around the command line, you can find out using tools like top, ps and pstree. If you're not that comfortable, you could install htop or something similar. If you call it in a terminal, you can use the up and down arrows to navigate to the "find" process and have a look at its process tree, i.e. by which tool(s) it was called.

heix

Re: FIND

Posted: Fri May 23, 2014 7:12 pm
by briandc
heix wrote:
briandc wrote:So what applications would envoke it at startup, and why? It seems quite strange..
If you know your way around the command line, you can find out using tools like top, ps and pstree. If you're not that comfortable, you could install htop or something similar. If you call it in a terminal, you can use the up and down arrows to navigate to the "find" process and have a look at its process tree, i.e. by which tool(s) it was called.

heix
Indeed, I discovered it was running just by running top. But how can I find the process tree?


brian

Re: FIND

Posted: Fri May 23, 2014 9:07 pm
by heix
briandc wrote: Indeed, I discovered it was running just by running top. But how can I find the process tree?
If you run top, you'll see a column "PID". Note the number you see there in the line that has "find" as command. Quit top and type pstree followed by the number (the "process id" of the find process) you saw in top.

Re: FIND

Posted: Sat May 24, 2014 9:12 am
by briandc
heix wrote:
briandc wrote: Indeed, I discovered it was running just by running top. But how can I find the process tree?
If you run top, you'll see a column "PID". Note the number you see there in the line that has "find" as command. Quit top and type pstree followed by the number (the "process id" of the find process) you saw in top.
I did what you suggested, and the result it gave was "find." Since the user for find is "nobody," I also tried

Code: Select all

pstree nobody
and it gave me

Code: Select all

su__sh__find
???


brian

Re: FIND

Posted: Sat May 24, 2014 10:43 am
by Thad E Ginathom
raboof wrote:'find' is not an application that does something useful in and of itself...
Aaargh, yes it is!

find is one of the most useful *nix commands and should be one of the first to be learned by anyone who ever opens a terminal window. It can be a little tricky, eg getting the quotes right when using it with wild cards, but that is all part of *nix first steps anyway.

Because of its power, the man page, with its numerous options could be a little daunting: -name, -ls and -print serve my purposes nine times out of ten.
it is a tool you can use when writing other scripts...
As well, yes indeed. It is one of the most vital administration tools.
Every now and then I can hear my pc processing even when I'm not doing anything. I ran "top" and found an app called "find"
Bottom line: why worry? Has it caused any problems? Your operating stuff is doing all sorts of stuff, often, when you are not doing anything. One of the reasons that we use Linux is that we expect it to be better at managing itself than some other OSs we could name.

Among the various options to find are those which list files by access and modification times, older or newer than. This is a vital admin tool, and it is quite possible that something like this is going on, perhaps to deal with outdated temp files, or old log files, etc etc. Removing the find binary would be like cutting off your arm because of mild itch on one finger. Don't even think about it!

Actually, there is a very good answer to the question Why worry? --- it is that an hour or two researching something like this, from the standpoint of pure curiosity, is a hugely educational process. It's how I did most of my learning back in the day when I earned my living from this stuff. Enjoy :)

Re: FIND

Posted: Sat May 24, 2014 2:26 pm
by briandc
Thad E Ginathom wrote:
Every now and then I can hear my pc processing even when I'm not doing anything. I ran "top" and found an app called "find"
Bottom line: why worry? Has it caused any problems? Your operating stuff is doing all sorts of stuff, often, when you are not doing anything. One of the reasons that we use Linux is that we expect it to be better at managing itself than some other OSs we could name.

Among the various options to find are those which list files by access and modification times, older or newer than. This is a vital admin tool, and it is quite possible that something like this is going on, perhaps to deal with outdated temp files, or old log files, etc etc. Removing the find binary would be like cutting off your arm because of mild itch on one finger. Don't even think about it!

Actually, there is a very good answer to the question Why worry? --- it is that an hour or two researching something like this, from the standpoint of pure curiosity, is a hugely educational process. It's how I did most of my learning back in the day when I earned my living from this stuff. Enjoy :)
True, true. It's not causing any "problems" per se, although something does seem to initiate the find process at every boot, and although it only lasts a few minutes, it does slow down things when I begin work (unless I wait for it to finish). And, there *must* be a reason why it happens. Knowing the answer is part of the learning. :)


brian