사용자 도구

사이트 도구


wiki:os:linux:리눅스에서_자주_사용하는_명령어

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
wiki:os:linux:리눅스에서_자주_사용하는_명령어 [2020/06/08 17:24]
jhgong
wiki:os:linux:리눅스에서_자주_사용하는_명령어 [2023/01/13 18:44] (현재)
줄 116: 줄 116:
 </code> </code>
  
 +===== lsof =====
 +list open files의 약자로 시스템에서 열린 파일목록을 알려주고 사용하는 프로세스, 디바이스 정보, 파일의 종류등 상세한 정보를 출력한다.
 +
 +<code bash>
 +$ lsof
 +
 +COMMAND    PID      USER   FD      TYPE             DEVICE SIZE/OFF       NODE NAME
 +init              root  cwd       DIR              253,0     4096          2 /
 +init              root  rtd       DIR              253,0     4096          2 /
 +init              root  txt       REG              253,0   150352       3932 /sbin/init
 +init              root  mem       REG              253,0    65928     784927 /lib64/libnss_files-2.12.so
 +init              root  DEL       REG              253,0              784911 /lib64/libc-2.12.so
 +init              root  DEL       REG              253,0              785325 /lib64/libgcc_s-4.4.7-20120601.so.1.#prelink#.YDRQV5
 +init              root  DEL       REG              253,0              784939 /lib64/librt-2.12.so
 +init              root  DEL       REG              253,0              784935 /lib64/libpthread-2.12.so.#prelink#.0jHMuJ
 +</code>
 +컬럼별 의미는 다음과 같다.
 +  * COMMAND : 실행한 명령어
 +  * PID : process id
 +  * USER : 실행한 사용자
 +  * FD: File Descriptor, 파일의 종류
 +  * TYPE : 파일 종류
 +  * DEVICE : 장치번호
 +  * SIZE/OFF : 파일의 크기나 오프셋
 +  * NODE : 노드번호
 +  * NAME : 파일명
 +
 +-i 옵션을 사용하여 IPv4 또는 IPv6 포트만 표시할수 있다.
 +<code bash>
 +$ lsof -i 4
 +
 +COMMAND    PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
 +rpcbind   1068     rpc    6u  IPv4  11858      0t0  UDP *:sunrpc 
 +rpcbind   1068     rpc    7u  IPv4  11860      0t0  UDP *:819 
 +rpcbind   1068     rpc    8u  IPv4  11861      0t0  TCP *:sunrpc (LISTEN)
 +rpc.statd 1086 rpcuser    5r  IPv4  11949      0t0  UDP *:838 
 +rpc.statd 1086 rpcuser    8u  IPv4  11955      0t0  UDP *:47492 
 +rpc.statd 1086 rpcuser    9u  IPv4  11959      0t0  TCP *:38374 (LISTEN)
 +cupsd     1159    root    7u  IPv4  12195      0t0  TCP localhost:ipp (LISTEN)
 +</code>
  
  
 ===== Ref ===== ===== Ref =====
   * [[https://serverfault.com/questions/62411/how-can-i-sort-du-h-output-by-size|How can I sort du -h output by size]]   * [[https://serverfault.com/questions/62411/how-can-i-sort-du-h-output-by-size|How can I sort du -h output by size]]
 +  * [[https://dora-guide.com/linux-commands/|리눅스 명령어 모음 50가지]]
  
-{{tag>김토피아 도봉산핵주먹 천호동밤안개 주레피 리눅스 ls find seq crontab tar}}+{{tag>김토피아 도봉산핵주먹 천호동밤안개 주레피 slaptear 리눅스 ls find seq crontab tar}}
/volume1/web/dokuwiki/data/attic/wiki/os/linux/리눅스에서_자주_사용하는_명령어.1591604647.txt.gz · 마지막으로 수정됨: 2022/03/10 19:52 (바깥 편집)