리눅스 프로세스 이름으로 PID 알아내기

Jmnote (토론 | 기여)님의 2012년 3월 1일 (목) 20:29 판
  • 프로세스 이름으로 프로세스 ID 알아내기

1 방법 1

가장 간단한 방법이지만, grep 프로세스 자신도 출력된다.

명령어
ps -ef | grep 프로세스이름
실행 예시
[root@localhost ~]# ps -ef | grep top
root     25285 25219  0 20:24 pts/0    00:00:00 top
root     25326 25288  0 20:24 pts/1    00:00:00 grep top

2 방법 2

방법1에서 grep 프로세스 제외시킨다.

명령어
ps -ef | grep 프로세스이름 | grep -v grep
실행 예시
[root@localhost ~]# ps -ef | grep top | grep -v grep
root     25285 25219  0 20:24 pts/0    00:00:00 top
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}