ตรวจสอบว่า Process เปิดไฟล์หรือ Port อะไรอยู่บ้าง

wk
1 min readMar 20, 2020

--

GUI

บน macOS มีโปรแกรม GUI คือ Sloth สามารถติดตั้งผ่าน Homebrew

$ brew cask install sloth

Command Line

ใช้คำสั่ง lsof โดยระบุ Process ID ที่ต้องการผ่าน Options -p เช่น

$ pidof Sourcetree                                                                                                                                                                                    70764$ lsof -p 70764

อาจยุบคำสั่งสำหรับหา Process ID ให้เหลือบรรทัดเดียวผ่าน xargs เช่น

$ pidof Sourcetree | xargs lsof -p

--

--

No responses yet