前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >看不懂man page, 小工具来帮你

看不懂man page, 小工具来帮你

原创
作者头像
追马
修改2020-07-01 10:29:22
4320
修改2020-07-01 10:29:22
举报
文章被收录于专栏:一日一工具一日一工具

看不懂man page, 小工具来帮你

对新手来说,尤其是英语功底不太好的小伙伴,去看命令的man page的时候,那么多参数,那么多指令,我该如何用,我该如何选择?(你的心情,下面的图就是最好的写照)多多少少会有些吃力,那是否有对新手友好的工具来实现快速上手的辅助工具呢?答案是肯定的,今天我就给你推荐两个小工具来帮你实现这个命令的快速上手,仅需两步就可以满足你的需求。

日常必备的工具

tldr

不单单支持pip安装,同时也支持npm, brew等方式安装,显示结果代码高亮,增加了可视化效果,而且还支持在线检索。

站点

tldr

安装
> pip install tldr
使用
> tldr tar
# tar

  Archiving utility.
  Often combined with a compression method, such as gzip or bzip.
  More information: <https://www.gnu.org/software/tar>.

- Create an archive from files:

  tar cf target.tar file1 file2 file3

- Create a gzipped archive:

  tar czf target.tar.gz file1 file2 file3

- Create a gzipped archive from a directory using relative paths:

  tar czf target.tar.gz -C path/to/directory .

- Extract a (compressed) archive into the current directory:

  tar xf source.tar[.gz|.bz2|.xz]

- Extract an archive into a target directory:

  tar xf source.tar -C directory

- Create a compressed archive, using archive suffix to determine the compression program:

  tar caf target.tar.xz file1 file2 file3

- List the contents of a tar file:

  tar tvf source.tar

- Extract files matching a pattern:

  tar xf source.tar --wildcards "*.html"

- Extract a specific file without preserving the folder structure:

  tar xf source.tar source.tar/path/to/extract --strip-components=depth_to_strip

cheat

该命令对应的仓库已经被move了,新版本我看是使用了go进行编写,我在下面有贴对应的地址。

站点

原仓库

go版本的cheat

安装
> pip install cheat
使用
>  cheat tar
# To extract an uncompressed archive:
tar -xvf /path/to/foo.tar

# To create an uncompressed archive:
tar -cvf /path/to/foo.tar /path/to/foo/

# To extract a .gz archive:
tar -xzvf /path/to/foo.tgz

# To create a .gz archive:
tar -czvf /path/to/foo.tgz /path/to/foo/

# To list the content of an .gz archive:
tar -ztvf /path/to/foo.tgz

# To extract a .bz2 archive:
tar -xjvf /path/to/foo.tgz

# To create a .bz2 archive:
tar -cjvf /path/to/foo.tgz /path/to/foo/

# To extract a .tar in specified Directory:
tar -xvf /path/to/foo.tar -C /path/to/destination/

# To list the content of an .bz2 archive:
tar -jtvf /path/to/foo.tgz

# To create a .gz archive and exclude all jpg,gif,... from the tgz
tar czvf /path/to/foo.tgz --exclude=\*.{jpg,gif,png,wmv,flv,tar.gz,zip} /path/to/foo/

# To use parallel (multi-threaded) implementation of compression algorithms:
tar -z ... -> tar -Ipigz ...
tar -j ... -> tar -Ipbzip2 ...
tar -J ... -> tar -Ipixz ...

总结

酒虽好,勿贪杯,工具只是辅助你快速的掌握一个默认的命令,要想深入的了解命令的完整使用方式和每个参数的使用场景,还是需要去仔细研读man page, 步子大了会扯着蛋的~,嗯,很疼

欢迎关注我的公众号“追马Linux”,原创技术文章第一时间推送。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 看不懂man page, 小工具来帮你
    • 日常必备的工具
      • tldr
      • cheat
    • 总结
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档