lsof ตรวจสอบการเปิดไฟล์ต่างๆ ใน linux

29 Nov 2015,
Share: 

ถ้าต้องการดูว่า โปรแกรมที่เราสนใจ เปิดใช้งานไฟล์ไหนบ้าง หรือเปิด socket อะไรบ้าง สามารถดูได้ด้วยคําสั่งนี้

lsof -c <ชื่อโปรแกรมที่ต้องกา>

ชื่อโปรแกรมที่ต้องการ คือ ชื่อโปรแกรมหรือ process ที่ต้องการจะดู

ตัวอย่างการใช้คําสั่ง

Image

lsof ตัวอย่างผลลัพธ์

Image

lsof ถ้าต้องการดูว่าระบบเปิดไฟล์ทั้งหมดสามารถใช้คําสั่งนี้

lsof | wc -l

Copyright © 2019 - 2025 thiti.dev |  v1.51.0 |  Privacy policy | 

Build with ❤️ and Astro.

Github profile   Linkedin profile   Instagram   X profile   Nostr   Youtube channel   Telegram   Email contact   วงแหวนเว็บ