본문 바로가기
리눅스 관련/명령어

ps 와 ps -ef

by 알 수 없는 사용자 2022. 5. 23.

https://manpages.ubuntu.com/manpages/trusty/en/man1/ps.1posix.html

 

Ubuntu Manpage: ps - report process status

Powered by the Ubuntu Manpage Repository, file bugs in Launchpad © 2019 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.

manpages.ubuntu.com

 


 

 

option 설명

       The  ps  utility  shall  conform  to  the Base Definitions volume of IEEE Std 1003.1-2001,
       Section 12.2, Utility Syntax Guidelines.

       The following options shall be supported:

       -a     Write information for all processes associated with terminals. Implementations  may
              omit session leaders from this list.

       -A     Write information for all processes.

       -d     Write information for all processes, except session leaders.

       -e     Write information for all processes.  (Equivalent to -A.)

       -f     Generate  a  full  listing.  (See  the  STDOUT  section  for the contents of a full
              listing.)

       -g  grouplist
              Write information for processes whose session leaders are given in  grouplist.  The
              application  shall  ensure that the grouplist is a single argument in the form of a
              <blank> or comma-separated list.

       -G  grouplist
              Write information for processes whose real group ID numbers are given in grouplist.
              The application shall ensure that the grouplist is a single argument in the form of
              a <blank> or comma-separated list.

       -l     Generate a long listing. (See STDOUT for the contents of a long listing.)

       -n  namelist
              Specify the name of an alternative system namelist file in place  of  the  default.
              The name of the default file and the format of a namelist file are unspecified.

       -o  format
              Write  information  according to the format specification given in format.  This is
              fully described in the STDOUT section.  Multiple -o options can be  specified;  the
              format specification shall be interpreted as the <space>-separated concatenation of
              all the format option-arguments.

       -p  proclist
              Write information for processes whose process ID numbers are given in proclist. The
              application  shall  ensure  that the proclist is a single argument in the form of a
              <blank> or comma-separated list.

       -t  termlist
              Write information for processes associated with terminals given  in  termlist.  The
              application  shall  ensure  that the termlist is a single argument in the form of a
              <blank> or  comma-separated  list.  Terminal  identifiers  shall  be  given  in  an
              implementation-defined format.    On XSI-conformant systems, they shall be given in
              one of two forms: the device's filename (for example, tty04) or,  if  the  device's
              filename  starts  with  tty,  just the identifier following the characters tty (for
              example, "04" ).

       -u  userlist
              Write information for processes whose user ID numbers or login names are  given  in
              userlist.  The  application  shall ensure that the userlist is a single argument in
              the form of a <blank> or comma-separated list. In the listing, the  numerical  user
              ID  shall  be  written  unless  the -f option is used, in which case the login name
              shall be written.

       -U  userlist
              Write information for processes whose real user ID numbers or login names are given
              in userlist. The application shall ensure that the userlist is a single argument in
              the form of a <blank> or comma-separated list.

       With the exception of -o format, all of the options shown are used to select processes. If
       any  are  specified,  the  default list shall be ignored and ps shall select the processes
       represented by the inclusive OR of all the selection-criteria options.



ps 유틸리티는 IEEE 규격 1003.1-2001의 기본 정의 볼륨을 준수해야 한다.
섹션 12.2, 유틸리티 구문 지침.

다음 옵션이 지원되어야 한다.

-a 터미널과 관련된 모든 프로세스에 대한 정보를 기록합니다. 구현은 다음을 수행할 수 있습니다.
이 목록에서 세션 리더를 제외합니다.

-A 모든 프로세스에 대한 정보를 기록합니다.

-d 세션 리더를 제외한 모든 프로세스에 대한 정보를 작성합니다.

-e 모든 공정에 대한 정보를 작성한다. (-A에 상당한다.)

-f 전체 목록을 생성합니다. (전체 목록은 STDOUT 절 참조)
목록 작성).

-g 그룹 목록
그룹 목록에 세션 리더가 지정된 프로세스에 대한 정보를 작성합니다. 그
신청서는 그룹 목록이 다음 형식의 단일 인수임을 보장해야 한다.
<공백> 또는 쉼표로 구분된 목록입니다.

-G 그룹 목록
그룹 목록에 실제 그룹 ID 번호가 지정된 프로세스에 대한 정보를 작성합니다.
신청서는 그룹 목록이 다음의 형태로 단일 인수임을 보장해야 한다.
<공백> 또는 쉼표로 구분된 목록.

-l 긴 목록을 생성합니다. (긴 목록의 내용은 STDOUT를 참조하십시오.)

-이름표
기본값 대신 대체 시스템 이름 목록 파일의 이름을 지정합니다.
기본 파일 이름과 이름 목록 파일 형식을 지정하지 않았습니다.

-o 형식
제공된 형식 사양에 따라 정보를 작성합니다. 이것은
STDOUT 섹션에 자세히 설명되어 있습니다. -o 옵션을 여러 개 지정할 수 있습니다.
형식 사양은 다음과 같은 <space>로 구분된 연결로 해석되어야 한다.
all format option-fromption.

-프롤리스트
프로세스 ID 번호가 프로클리스트에 지정된 프로세스에 대한 정보를 작성합니다. 그
적용은 선언자가 다음 형식의 단일 주장이 되도록 보장해야 한다.
<공백> 또는 쉼표로 구분된 목록입니다.

-t 용어 목록
용어 목록에 제공된 터미널과 관련된 프로세스에 대한 정보를 작성합니다. 그
신청서는 용어 목록이 다음 형식의 단일 인수임을 보장해야 한다.
<공백> 또는 쉼표로 구분된 목록입니다. 터미널 식별자는 다음과 같이 제공되어야 한다.
구현에 정의된 형식입니다. XSI 준수 시스템의 경우 다음과 같이 제시되어야 한다.
장치의 파일 이름(예: tty04) 또는 장치의 파일 이름인 경우
filename은 tty로 시작하며, 문자 tty 뒤에 오는 식별자만 있습니다.
예: "04").

-u 사용자 목록
사용자 ID 번호 또는 로그인 이름이 지정된 프로세스에 대한 정보 작성
사용자 목록. 신청서는 사용자 목록이 다음의 단일 인수임을 보장해야 한다.
<공백> 또는 쉼표로 구분된 목록의 형식입니다. 목록에서 숫자 사용자는
-f 옵션을 사용하지 않는 한 ID를 작성해야 합니다. 이 경우 로그인 이름
기록되어야 한다.

-U 사용자 목록
실제 사용자 ID 번호 또는 로그인 이름이 지정된 프로세스에 대한 정보 작성
사용자 목록에 있습니다. 신청서는 사용자 목록이 다음의 단일 인수임을 보장해야 한다.
<공백> 또는 쉼표로 구분된 목록의 형식입니다.

-o 형식을 제외하고 표시된 모든 옵션은 프로세스를 선택하는 데 사용됩니다. 한다면
any 가 지정되어 있으며, 기본 목록은 무시되어야 하며 ps는 프로세스를 선택해야 합니다.
모든 선택 기준 옵션의 포함 OR로 표시됩니다.

 


 

결론 :

ps -a

- 터미널과 관련된 프로세스 정보를 출력

 

ps -A

- 모든 프로세스에 대한 정보를 출력

 

ps -e

- 모든 공정에 대한 정보를 작성한다.( -A랑 똑가틈 )

 

ps -f

- UID PID PPID C STIME TTY TIME CMD 등 여러 정보를 나타낸다.

 

일일히 기억하기 귀찮으니까

프로세스관련된거 전부다 ~ , 관련된프로세스 정보도 전부다~  ---> ps -ef

ps -ef 중에서 "roscore"와 관련된거만 전부다~                      ---> ps -ef | grep roscore

 

 

 

 

 

 

 

 

 

 

댓글