728x90
반응형
Linux
$ netstat -nap | grep 9393
$ fuser -k -n tcp
macOS
MacBook-Pro pingate % lsof --help
lsof: illegal option character: -
lsof: illegal option character: e
lsof: no process ID specified
lsof 4.91
latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ
latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man
usage: [-?abhlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]]
[-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]] [-p s]
[+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]
Defaults in parentheses; comma-separated set (s) items; dash-separated ranges.
-?|-h list help -a AND selections (OR) -b avoid kernel blocks
-c c cmd c ^c /c/[bix] +c w COMMAND width (9) +d s dir s files
-d s select by FD set +D D dir D tree *SLOW?* -i select IPv[46] files
-l list UID numbers -n no host names -N select NFS files
-o list file offset -O no overhead *RISKY* -P no port names
-R list paRent PID -s list file size -t terse listing
-T disable TCP/TPI info -U select Unix socket -v list version info
-V verbose search +|-w Warnings (+) -X file descriptor table only
-- end option scan
+f|-f +filesystem or -file names +|-f[cgG] Ct flaGs
-F [f] select fields; -F? for help
+|-L [l] list (+) suppress (-) link counts < l (0 = all; default = 0)
+|-M portMap registration (-) -o o o 0t offset digits (8)
-p s exclude(^)|select PIDs -S [t] t second stat timeout (15)
-T fqs TCP/TPI Fl,Q,St (s) info
-g [s] exclude(^)|select and print process group IDs
-i i select by IPv[46] address: [46][proto][@host|addr][:svc_list|port_list]
+|-r [t[m<fmt>]] repeat every t seconds (15); + until no files, - forever.
An optional suffix to t is m<fmt>; m must separate t from <fmt> and
<fmt> is an strftime(3) format for the marker line.
-s p:s exclude(^)|select protocol (p = TCP|UDP) states by name(s).
-u s exclude(^)|select login|UID set s
-x [fl] cross over +d|+D File systems or symbolic Links
names select named files or files on named file systems
Anyone can list all files; /dev warnings disabled; kernel ID check disabled.
$ lsof -i tcp:9393
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
php 1666 userName 7u IPv6 0x12345ba67d08ea08 0t0 TCP localhost:9393 (LISTEN)
$ kill -9 1666
참고사이트
https://intro0517.tistory.com/123
리눅스 특정포트 확인 및 죽이기
1. 포트확인 netstat -nap | grep 8080 2. 포트죽이기 fuser -k -n tcp 8080
intro0517.tistory.com
Mac 에서 프로세스 상태 확인하는 방법
Mac 에서 프로세스 상태 확인 시스템에서 프로세스 상태 확인이 필요할때가 생각보다 많다. 예를들어 이클립스에서 로컬 80포트로 서버를 띄우려고 하는데 포트가 이미 사용중이라고 에러와 함��
ithub.tistory.com
728x90
반응형
'mac os' 카테고리의 다른 글
파일 내용 보는 linux command (0) | 2020.06.24 |
---|---|
[macOS] 서버(DB, httpd) 관리툴 (0) | 2020.06.24 |
맥에서 한자 입력하기 (0) | 2020.06.17 |
crontab 파일로 원상복구 (0) | 2020.06.17 |
맥 단축키 vs 윈도우 단축키 (0) | 2020.06.16 |