Tip-Linux Command lsof

OverView

lsof
list all open files

  • to list all open files

lsof

  • to list opened files by process belong to specific user

lsof -u [username]

  • list opened files based on their internet address

lsof -i 4
lsof -i 6

  • list opened files based on specific pid

lsof -p [pid]
lsof -p [^pid], use ^ means exclude the pid

  • list pids which process open the specific file

lsof -t [filename with path]

  • limit lsof to a directory

lsof +D [directory]

  • list all internet and x.25 network files

lsof -i 没有参数

  • list all opened files based on port range

lsof -i :1-1024

  • list all opened files based on type of connection (tcp/udp)

lsof -i udp

  • list parent pid of the process

lsof -p [pid] -R
attention, use "-R"

Lsof Reference

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 10,889评论 0 23
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,717评论 0 10
  • 秋风拂面 再也拂不出悠然诗意 随波而去的思念 似乎也没有了归宿 我还会去桥头踟躅 可再也听不见桨橹的咿哦 传说里的...
    金永辉煌阅读 560评论 23 12
  • 我没有特别的爱好,平时喜欢看看书,看看电影,听听音乐。这些爱好都是不花钱但花时间的,对我来讲最合适了。今天中午休息...
    老撒阅读 1,012评论 2 13
  • 看某音乐MV,看到熟悉的一段:一个教练趴在地上给正在做“死亡爬行”的橄榄球队员呐喊鼓劲。 突然,想起高三时班主任...
    吟墨阅读 1,063评论 0 1

友情链接更多精彩内容