tldr-实用的命令查询工具

介绍主页(上面有多种安装该工具的方法):https://github.com/tldr-pages/tldr
这里只演示使用pip的安装方法,

pip install tldr

查询lsof命令的使用方法:

Mac-Pro:~ K$ tldr lsof
# lsof

  Lists open files and the corresponding processes.
  Note: Root privileges (or sudo) is required to list files opened by others.

- Find the processes that have a given file open:

  lsof path/to/file

- Find the process that opened a local internet port:

  lsof -i :port

- Only output the process ID (PID):

  lsof -t path/to/file

- List files opened by the given user:

  lsof -u username

- List files opened by the given command or process:

  lsof -c process_or_command_name

- List files opened by a specific process, given its PID:

  lsof -p PID

- List open files in a directory:

  lsof +D path/to/directory

总体来说比起man命令查询的结果要简洁多,每个使用方法都有解释。

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

相关阅读更多精彩内容

  • 一、Python简介和环境搭建以及pip的安装 4课时实验课主要内容 【Python简介】: Python 是一个...
    _小老虎_阅读 6,385评论 0 10
  • # Python 资源大全中文版 我想很多程序员应该记得 GitHub 上有一个 Awesome - XXX 系列...
    小迈克阅读 3,155评论 1 3
  • “大家好,我是老陈····” 今天展示的作品都是老陈2010年前后创作的水彩画。 11月份,北京进入初冬深秋的季节...
    安妮吖长点心阅读 1,231评论 0 3
  • 人生自古有别离,恨难相聚重逢时,魔都的千万人流,也撑不起人间所有的梦,一个个梦的破碎,也并不会感到有任何的悲...
    461A127阅读 232评论 0 2
  • 很多人不喜欢猫咪,说它养不熟,对它再好,它也是任意对待主人,甚至说是反骨~ 在我看来,猫咪,非常有个性。 很清晰自...
    黄诗韵17觉醒阅读 637评论 0 1

友情链接更多精彩内容