Finding the first pid
Hi,
I want to find the first pid of a process, if I type... pidof strs i get 2606 2607 2608 2609 ... Anyone know how can I just return 2606? Thanks |
How about:
pidof strs|cut -d " " -f 1 EDIT: Hey I read the man page of pidof and it actually has a flag that does this: -s Single shot - this instructs the program to only return one pid. man pidof :) |
Sorry m0rl0ck should have read the man page thoughly first. But using cut in this way is will be very useful for me for other things as well
Thanks |
All times are GMT -5. The time now is 11:17 PM. |