전체 프로세스 목록을 맨 위로 보는 방법 절전 상태에 있음을 알게됩니다. 그 시점에서

‘정상’을 수행하면 많은 프로세스가 절전 상태에 있음을 알게됩니다. 그 시점에서 모든 프로세스의 완전한 스냅 샷을 볼 필요가 있습니다. ‘상단’은 한 화면에 맞는 프로세스 목록을 표시 할 수 있습니다. 전체 목록은 어떻게 얻습니까?

무엇보다도 “절전”상태 인 모든 프로세스 목록을보고 싶습니다. “ps”명령의 출력에서 ​​프로세스 상태를 얻을 수 있다고 생각하지 않습니다.



답변

top -b 트릭을하고있는 것 같습니다.


답변

coreutils로 프로세스 상태를 얻을 수 있습니다 ps

$ ps aux

그 모든 것을 나열 할 것입니다. 매뉴얼 페이지에서이를 디코딩하는 방법은 다음과 같습니다.

프로세스 상태 코드

다음은 프로세스 상태를 설명하기 위해 s, stat 및 state 출력 지정자 (헤더 “STAT”또는 “S”)가 표시하는 다른 값입니다.

   D    uninterruptible sleep (usually IO)
   R    running or runnable (on run queue)
   S    interruptible sleep (waiting for an event to complete)
   T    stopped, either by a job control signal or because it is being traced.
   W    paging (not valid since the 2.6.xx kernel)
   X    dead (should never be seen)
   Z    defunct ("zombie") process, terminated but not reaped by its parent.

BSD 형식 및 stat 키워드를 사용하는 경우 추가 문자가 표시 될 수 있습니다.

   <    high-priority (not nice to other users)
   N    low-priority (nice to other users)
   L    has pages locked into memory (for real-time and custom IO)
   s    is a session leader
   l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
   +    is in the foreground process group.