Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. PID TTY STAT TIME COMMAND
  2. 3476 pts/0 S 0:00 su ...
  3. 3477 pts/0 S 0:02 _ bash
  4. 8062 pts/0 T 1:16 _ emacs -nw ...
  5. 15733 pts/0 R+ 0:00 _ ps xf
  6. 15237 ? S 0:00 uwsgi ...
  7. 15293 ? S 0:00 _ uwsgi ...
  8. 15294 ? S 0:00 _ uwsgi ...
  9.  
  10. ps xf | sed '1d' | while read pid tty stat time command ; do [ -n "$(echo $command | egrep '^uwsgi')" ] && echo $pid ; done
  11.  
  12. $ ps hf -opid -C <process> | awk '{ print $1; exit }'
  13.  
  14. ps rf -opid,cmd -C <process-name> | awk '$2 !~ /^[|\]/ { print $1 }'
  15.  
  16. $ ps f -opid,cmd -Cchromium
  17. PID CMD
  18. 2800 /usr/lib/chromium/chromium --type=zygote --enable-seccomp-sandbox
  19. 2803 _ /usr/lib/chromium/chromium --type=zygote --enable-seccomp-sandbox
  20. 2899 _ /usr/lib/chromium/chromium --type=renderer --enable-seccomp-sandbox --lang=en-US --force-fieldtrials=ConnCountImpact/conn_count_6/ConnnectB
  21. 2906 | _ /usr/lib/chromium/chromium --type=renderer --enable-seccomp-sandbox --lang=en-US --force-fieldtrials=ConnCountImpact/conn_count_6/Connn
  22. [ ... snip ... ]
  23. 2861 _ /usr/lib/chromium/chromium --type=renderer --enable-seccomp-sandbox --lang=en-US --force-fieldtrials=ConnCountImpact/conn_count_6/ConnnectB
  24. 2863 _ /usr/lib/chromium/chromium --type=renderer --enable-seccomp-sandbox --lang=en-US --force-fieldtrials=ConnCountImpact/conn_count_6/Connn
  25. 2794 /usr/lib/chromium/chromium --enable-seccomp-sandbox --memory-model=low --purge-memory-button --disk-cache-dir=/tmp/chromium
  26. 2796 _ /usr/lib/chromium/chromium --enable-seccomp-sandbox --memory-model=low --purge-memory-button --disk-cache-dir=/tmp/chromium
  27. 3918 _ /usr/lib/chromium/chromium --type=gpu-process --channel=2794.45.1891443837 --gpu-vendor-id=0x10de --gpu-device-id=0x0611 --gpu-driver-version -
  28. 25308 _ [chromium] <defunct>
  29. 31932 _ /usr/lib/chromium/chromium --type=plugin --plugin-path=/usr/lib/mozilla/plugins/libflashplayer.so --lang=en-US --channel=2794.1330.1990362572
  30.  
  31.  
  32. $ ps f -opid,cmd -Cchromium | awk '$2 !~ /^[|\]/ { print $1 }'
  33. PID
  34. 2800
  35. 2794
  36.  
  37. $ # also supressing the header of ps (top line 'PID') -- add 'h' to ps
  38. $ ps hf -opid,cmd -Cchromium | awk '$2 !~ /^[|\]/ { print $1 }'
  39. 2800
  40. 2794
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement