View Full Version : Get pid based on command

06-30-2006, 08:09 PM
Is there a function somewhere that will let me pass it the executable file name and it will return the pid (if its running)?

I thought I'd ask before writing a function to trawl through /proc/xxxx/cmdline for all processes.

07-01-2006, 12:52 AM
What if the same executable is running several times?

Nothing springs to mind for what you want.