# 특정 포트 검색
$ netstat -nltp | grep 8080
# 특정 포트에서 사용하는 프로그램 확인
$ lsof -t tcp:8080
# 특정 포트를 사용하는 프로그램 죽이기
$ fuser -k -n tcp 8080
# 해당 프로세스 죽이기
$ kill -9 1234
# 조건문을 이용한 특정 포트에서 사용하는 프로그램 죽이기
$
if netstat -nap | grep 80
then
echo "80 port is opened"
fuser -k -n tcp 80
else
echo "80 port is not opened"
fi
Last active
June 11, 2023 14:49
-
-
Save maketheworldwise/e980c7afa3c7d1b427c6335a980c001c to your computer and use it in GitHub Desktop.
[Linux] 유용하게 사용하는 리눅스 명령어
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment