script 썸네일형 리스트형 Port로 PID 찾기 현재 사용하고 있는 port를 어떤 프로세스가 사용하고 있는지 확인하는 명령이다. lsof -i:PORT번호 위와 같은 명령을 통해 검색 가능하다. 아래는 MySQL에서 사용하고 있는 모든 port의 PID를 검색하는 스크립트이다. #!/bin/sh PORTS=`mysql -uroot -pmegaroot -N information_schema -e "select substr(host,locate(':',host)+1) from information_schema.processlist where locate(':',host)!=0"` for i in $PORTS do lsof -i:$i done; 이전 1 다음