Lsof

lsof
개발자빅터 A. 아벨[1]
발표일1991년(35년 전)(1991)[2]
안정화 버전
4.99.7[3] / 2026년 6월 16일(2개월 전)(2026년 6월 16일)
저장소
라이선스BSD 라이선스 호환[4]
웹사이트people.freebsd.org/~abe/

lsof는 list open files(열려있는 파일 나열)을 뜻하는 명령으로, 수많은 유닉스 계열 운영 체제에서 열려있는 모든 파일과, 그 파일들을 열고 있는 프로세스들의 목록을 출력한다. 이 오픈 소스 유틸리티는 퍼듀 대학교 컴퓨팅 센터의 부소장으로 은퇴한 빅터 A. 아벨이 개발·지원하였다. 일부 유닉스 계열에서 동작하며 지원한다.[5]

시스템에 열려 있는 파일들로는 모든 프로세스가 열고 있는 디스크 파일, 지명 파이프, 네트워크 소켓, 장치를 포함한다. 지정되지 않은 파일들이 사용 중이라는 이유로 디스크를 마운트할 수 없을 때 이용하면 유용하다. 열려있는 파일들을 사용하고 있는 프로세스를 식별하기 위해 (필요 시 적절히 필터링도 가능) 사용할 수 있다.

# lsof /var
COMMAND     PID     USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
syslogd     350     root    5w  VREG  222,5        0 440818 /var/adm/messages
syslogd     350     root    6w  VREG  222,5   339098   6248 /var/log/syslog
cron        353     root  cwd   VDIR  222,5      512 254550 /var -- atjobs

데몬과 관련된 포트를 보는 방법은 다음과 같다:

# lsof -i -n -P | grep sendmail
sendmail  31649    root    4u  IPv4 521738       TCP *:25 (LISTEN)

위에서 "sendmail"을 보면 표준 포트 25를 대기하고 있는 것을 확인할 수 있다.

  • -i IP 소켓을 나열한다.
  • -n 호스트 이름을 결정하지 않는다 (DNS 없음).
  • -P 포트 이름을 결정하지 않는다 (이름 대신 포트 번호 나열).

lsof -U를 이용하면 유닉스 소켓을 나열할 수 있다.

같이 보기

각주

  1. “PGP public key”. 2013년 1월 15일에 확인함. [깨진 링크(과거 내용 찾기)]
  2. “v25i002: lsof - a successor to fstat and ofiles”. comp.sources.unix. 2023년 1월 10일에 원본 문서에서 보존된 문서. 2023년 4월 13일에 확인함. 
  3. lsof-org. “Release lsof 4.99.7 · lsof-org/lsof” (영어). 2026년 6월 17일에 확인함. 
  4. lsof FAQ, 1.9 Is there an lsof license?[깨진 링크(과거 내용 찾기)]
  5. W. Richard Stevens; Bill Fenner; Andrew M. Rudoff (2003). 《Unix Network Programming: the Sockets networking API》. Addison-Wesley Professional. ISBN 978-0-13-141155-5. 

외부 링크

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.