2011년 7월 12일 화요일

bash : 특정 process status 표시하기

한줄 command로 특정 process status를 표시하는 방법.

$ ps -ef |grep [process_bin] |grep -v grep \
|cut -d ' ' -f 2 |xargs -i cat /proc/{}/status

* cut 명령어 부분은 ps -ef의 표시 방법에 따라서 적절하게 변경해야 한다.
* grep명령어 부분은 grep [P]rocess_bin 과 같이 "[]"를 이용해서 하나로 쓸 수 있다.

댓글 없음:

댓글 쓰기