简介
tldr(too long didn’t read)字面含义,太长不看,大家知道linux给广大用户提供了一个非常完善的文档系统,只要通过一个man命令就可以查看linux下所有命令的用法,但是全的不意味着好用,在实际的工程应用场景大家都希望很快得到自己想要的东西然后继续干活,因此一个由社区维护的linux命令简洁版手册tldr就诞生了,大家可以简单感受下man和tldr的区别。(大家蛮喜欢用tar这个命令来对比的)
-> tldr tar
- [c]reate an archive from [f]iles:
tar cf {{target.tar}} {{file1}} {{file2}} {{file3}}
- [c]reate a g[z]ipped archive from [f]iles:
tar czf {{target.tar.gz}} {{file1}} {{file2}} {{file3}}
- [c]reate a g[z]ipped archive from a directory using relative paths:
tar czf {{target.tar.gz}} --directory={{path/to/directory}} .
- E[x]tract a (compressed) archive [f]ile into the current directory:
tar xf {{source.tar[.gz|.bz2|.xz]}}
- E[x]tract a (compressed) archive [f]ile into the target directory:
tar xf {{source.tar[.gz|.bz2|.xz]}} --directory={{directory}}
- [c]reate a compressed archive from [f]iles, using [a]rchive suffix to determine the compression program:
tar caf {{target.tar.xz}} {{file1}} {{file2}} {{file3}}
- Lis[t] the contents of a tar [f]ile [v]erbosely:
tar tvf {{source.tar}}
- E[x]tract [f]iles matching a pattern:
tar xf {{source.tar}} --wildcards "{{*.html}}"
-> man tar
TAR(1) GNU TAR Manual TAR(1)
NAME
tar - an archiving utility
SYNOPSIS
Traditional usage
tar {A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo] [ARG...]
UNIX-style usage
tar -A [OPTIONS] ARCHIVE ARCHIVE
tar -c [-f ARCHIVE] [OPTIONS] [FILE...]
tar -d [-f ARCHIVE] [OPTIONS] [FILE...]
tar -t [-f ARCHIVE] [OPTIONS] [MEMBER...]
tar -r [-f ARCHIVE] [OPTIONS] [FILE...]
tar -u [-f ARCHIVE] [OPTIONS] [FILE...]
tar -x [-f ARCHIVE] [OPTIONS] [MEMBER...]
GNU-style usage
tar {--catenate|--concatenate} [OPTIONS] ARCHIVE ARCHIVE
tar --create [--file ARCHIVE] [OPTIONS] [FILE...]
tar {--diff|--compare} [--file ARCHIVE] [OPTIONS] [FILE...]
tar --delete [--file ARCHIVE] [OPTIONS] [MEMBER...]
tar --append [-f ARCHIVE] [OPTIONS] [FILE...]
tar --list [-f ARCHIVE] [OPTIONS] [MEMBER...]
tar --test-label [--file ARCHIVE] [OPTIONS] [LABEL...]
tar --update [--file ARCHIVE] [OPTIONS] [FILE...]
tar --update [-f ARCHIVE] [OPTIONS] [FILE...]
tar {--extract|--get} [-f ARCHIVE] [OPTIONS] [MEMBER...]
NOTE
This manpage is a short description of GNU tar. For a detailed discus‐
sion, including examples and usage recommendations, refer to the GNU Tar
Manual available in texinfo format. If the info reader and the tar docu‐
mentation are properly installed on your system, the command
info tar
should give you access to the complete manual.
You can also view the manual using the info mode in emacs(1), or find it
in various formats online at
http://www.gnu.org/software/tar/manual
If any discrepancies occur between this manpage and the GNU Tar Manual,
the later shall be considered the authoritative source.
DESCRIPTION
GNU tar is an archiving program designed to store multiple files in a 此处略去一万字...
man大而全,tldr小而美,无论是你工作还是学习,tldr适合大多数用户,因为它足够简洁,足够高效。
安装
安装也非常简单,在ubuntu/debian下的安装方法如下:
sudo apt-get install tldr
其实说白了就是使用各自系统下的包管理工具安装即可。
安装成功后,并没有结束,因为这个工具还在不断更新,更新的内容托管在github平台上,所以每次查询都要去github上逛一圈同步最新的文档,但是因为众所周知的原因,国内用户可能会卡在同步的过程,想要查询的内容需要等很久,这显然与tldr的初衷背道而驰,所以需要把同步地址改成国内镜像:
cd ~ && mkdir -p .tldr/tldr
git clone https://gitee.com/tm_1/tldr ~/.tldr/tldr # 为了防止国内镜像挂掉,这里可以自己做一个镜像仓库,换成自己的镜像地址
使用
最后,enjoy it!使用也很简单,和使用man一样,tldr后面跟想要查询的命令就可以。
->~$ tldr tldr
tldr
Displays simple help pages for command-line tools, from the tldr-pages project.More information: https://tldr.sh.
- Get typical usages of a command (hint: this is how you got here!):
tldr {{command}}
- Show the tar tldr page for Linux:
tldr -p {{linux}} {{tar}}
- Get help for a Git subcommand:
tldr {{git-checkout}}
- Update local pages (if the client supports caching):
tldr -u