어떻게 활용해야 할까?
내게 필요한 것은 다음 사항이다.
macOS, Linux 기준으로 필요한 명령어만 정리했으니 외워서 쓸 수 있도록 하자.
lsof
typr of files and it's identification
sudo lsof -nP -iTCP -sTCP:LISTEN
sudo lsof -nP -iTCP -sTCP:LISTEN
lsof -i TCP:22
lsof -nP -iTCP -sTCP:LISTEN | grep 8080
java 4582 johan 194u IPv6 0x1de155f6b2c74d03 0t0 TCP *:websm (LISTEN)
# 4582 is the pid listening on port 8080
lsof -p <PID>
kill -9 <PID>
man lsof
lsof -nP
-n (inhibits the conversion of network numbers to host names for network files)
-P (inhibits the conversion of port numbers to port names for network files)