So the system I'm working on (BusyBox) has a ps that takes no command line arguments and pidof returns nothing even though it exists within /sbin and points to killall5.

Another issue I had is that top takes no -H, but you can hit h (not H) in top to view the individual threads.

Any tips on how I can generate a list of all PID's under a given process name?

  • What system is this? Why are you tagging as Linux? It does not sound like one. – terdon Feb 19 '14 at 19:23
  • I guess technically it's BusyBox, but I think Linux still applies. – Madau Feb 20 '14 at 19:56
  • Ah, no, BusyBox is not Linux though it can work with the Linux kernel. It is most definitely not GNU/Linux in any case. – terdon Feb 20 '14 at 20:06

In case you have limited find (no -printf option):

find /proc -mindepth 2 -maxdepth 2 -name exe -exec ls -lh {} \; 2>/dev/null 

Looking for bash:

find /proc -mindepth 2 -maxdepth 2 -name exe -lname '*/bash' \
    -printf %h\\n 2>/dev/null | 
sed s+^/proc/++
  • Hey, so I think this is getting really close to what I'm looking for, but the version of find I'm working with does not have -lname as a possible expression. – Madau Feb 19 '14 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.