3 ms·
Or you could ask ps to do most of the work for you: ps -u www-data -o pid --no-headers That gives me just the PIDs of the processes run by www-data.
by jgrahamc 17y ago
Or you could ask ps to do most of the work for you:
ps -u www-data -o pid --no-headers
That gives me just the PIDs of the processes run by www-data.
- jacquesm 17y agoMakes you wonder how much shell script code is written every year by people that have not yet cracked the manual on section '1'. So much good stuff in there. Good reminder to do a periodic review of that stuff, not all the options are easy to remember if you don't use them frequently enough.
- jgrahamc 17y agoActually, I can never remember any of the options. I find myself doing man FOO all the time and usually work under the assumption that there's probably already an option to do the thing I'm trying to do. Kudos to the original poster. That sort of combining of small tools is what the NIX command-line is all about.
- askorkin 17y agoThats a great one as well, didn't even realise ps could do that