BLOG ARTICLE Program/linux | 1 ARTICLE FOUND

  1. 2023.09.06 linux ps 정렬

linux ps 정렬

Program/linux 2023. 9. 6. 12:36

ps내역을 트리 형태로 정렬하여 출력하기.

 

ps -o pid,ppid,pgid,stime,command | head -1; ps -Ae -o pid,ppid,pgid,start_time,command --sort=pgid,start_time | grep -v color= | grep silf

 

ps -o pid,ppid,pgid,stime,command | head -1 : -o 옵션으로 출력할 내용 지정 (head -1을 통해 header 표기)

--sort=pgid,start_time : pgid, start_time순으로 표기

grep -v : 뒷 문장 제외하고 출력

grep silf : silf 문구가 포함된 process 출력

 

kill -9 pid : 해당 pid 중지

    kill -- -pgid : 해당 pgid에 해당하는 pid들 중지

 

AND