티스토리 뷰

카테고리 없음

lsof - list open files

cozynow 2020. 1. 4. 02:00

lsof는 시스템에서 열린 파일 목록을 알려주고 사용하는 프로세스, 디바이스, 파일등의 정보를 출력해준다,

 

특정 명령어가 사용하는 포트

lsof -c httpd 

 

포트 범의를 지정하여 관련 프로세스 리스트 업

lsof -i TCP:22-80

 

열린 모든 포트 보기

lsof -i

 

특정 포트의 프로세스를 찾을때,

lsof -i TCP:22

 

특정 사용자가 오픈한 프로세스 중지

kill -KILL `lsof -t -u lesstif`

 

LISTEN 하는 포트의 프로세스 리스트 업

sudo lsof -i -P -n | grep LISTEN

 

*netstat -tulpn | grep LISTEN 와 같음

 

ref : https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/

 

How to check if port is in use on Linux or Unix - nixCraft

Explains how to check the listening ports and applications with various Linux and Unix commands.

www.cyberciti.biz

ref:https://www.lesstif.com/pages/viewpage.action?pageId=20776078

 

lsof 사용법

lsof 는 list open files 의 약자로 시스템에서 열린 파일 목록을 알려주고 사용하는 프로세스, 디바이스 정보, 파일의 종류등 상세한 정보를 출력해 준다.

www.lesstif.com

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함