개발

[linux] port를 점유하고 있는 pid 찾기

2023. 6. 2. 21:48

port를 사용하고 있는 pid를 찾고 싶을 때가 있다.

이때 사용할 수 있는 명령어는 ss, netset, lsof가 있다.

 

$ sudo ss -lptn 'sport = :80'
State   Local Address:Port  Peer Address:Port              
LISTEN  127.0.0.1:80        *:*                users:(("nginx",pid=125004,fd=12))
LISTEN  ::1:80              :::*               users:(("nginx",pid=125004,fd=11))
$ sudo netstat -nlp | grep :80
tcp  0  0  0.0.0.0:80  0.0.0.0:*  LISTEN  125004/nginx
$ sudo lsof -n -i :80 | grep LISTEN
nginx   125004 nginx    3u  IPv4   6645      0t0  TCP 0.0.0.0:80 (LISTEN)

 

 

[출처]

  • https://unix.stackexchange.com/questions/106561/finding-the-pid-of-the-process-using-a-specific-port

 

 

728x90
저작자표시 비영리 변경금지 (새창열림)

'개발' 카테고리의 다른 글

[Miniconda] CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. 에러  (0) 2023.07.08
TensorRT와 Triton  (1) 2023.06.25
[linux] pid로 실행중인 파일 찾기  (0) 2023.06.02
[Docker] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 해결  (0) 2023.05.22
[sar] ubuntu로 시스템 stat 찍기  (0) 2023.03.21
'개발' 카테고리의 다른 글
  • [Miniconda] CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. 에러
  • TensorRT와 Triton
  • [linux] pid로 실행중인 파일 찾기
  • [Docker] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 해결
Fine애플
Fine애플
이것저것
Fine애플
끄적끄적
Fine애플
전체
오늘
어제
  • 분류 전체보기 (167)
    • 논문 및 개념 정리 (27)
    • Pattern Recognition (8)
    • 개발 (57)
    • python 메모 (45)
    • pytorch, tensorflow (5)
    • 알고리즘 (9)
    • Toy Projects (4)
    • 통계이론 (2)
    • Reinforcement Learning (10)

블로그 메뉴

  • 홈

공지사항

인기 글

태그

  • python
  • miniconda
  • tensorflow
  • pandas
  • 자연어
  • Probability
  • Bert
  • container
  • 개발환경
  • reinforcement learning
  • GPU
  • 알고리즘
  • PyTorch
  • ubuntu
  • transformer
  • 언어모델
  • nlp
  • 딥러닝
  • BigBird
  • Docker

최근 댓글

최근 글

hELLO · Designed By 정상우.
Fine애플
[linux] port를 점유하고 있는 pid 찾기
상단으로

티스토리툴바

개인정보

  • 티스토리 홈
  • 포럼
  • 로그인

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.