lsof - list open files
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