Linux

port로 pid 찾기

I장군T 2022. 4. 12. 00:56
반응형

linux

ps -lntp | grep port

 

solaris는 pid를 찾는 명령어가 없어 shell 작성필요

pid_search.sh

-----------------------------------

#!/bin/bash

if [ $# -lt 1 ]

then

ehco "parameter port please"

exit

fi

 

for i in `ls /proc`

do

pfiles $i | grep AF_INET | grep $1

if [ $? -eq 0 ]

then

echo pid $i

fi

done

-----------------------------------

 

ex> pid_search.sh 10000

반응형

'Linux' 카테고리의 다른 글

nginx 파일 업로드 용량 제한  (0) 2022.04.22
솔라리스 redis 설치  (0) 2022.04.12
linux pid 조회 시 프로세스명 안짤리고 보는법  (0) 2022.04.12
Nginx 명령어 및 옵션  (0) 2022.04.08
linux 네크워크 설정  (0) 2022.04.08