本文共 3382 字,大约阅读时间需要 11 分钟。
tldr
Command line users know to how read the manual: type “man” followed by the name of a command—you’ll see a detailed explanation. These manuals are useful but verbose, using hundreds of words to explain every detail of a command.
命令行用户知道如何阅读该手册:键入“ man”,后跟命令名称,您将看到详细的说明。 这些手册有用但冗长,使用数百个单词来解释命令的每个细节。
That’s fine when you want to know everything, but most of the time you’re looking for one specific usage. The project crows sources concise explanations instead, and lets you look up any application by typing “tldr” followed by the command’s name. It’s perfect for when you need a quick refresher, and is supported on Linux and Mac systems.
当您想了解所有内容时很好,但是大多数时候您正在寻找一种特定的用法。 相反,项目 crows会提供简洁的说明,并允许您通过键入“ tldr”和命令名称来查找任何应用程序。 当您需要快速复习时,它是完美的选择,并且在Linux和Mac系统上受支持。
Let’s say you forgot the finer points of using cd
, the command for changing folders. You could type man cd
, but the results aren’t going to be straightforward.
假设您忘记了使用cd
(更改文件夹的命令)的要点。 您可以输入man cd
,但是结果将不会很简单。
If you have tldr installed, type tldr cd
instead. You’ll see only the most pertinent points.
如果安装了tldr,请键入tldr cd
。 您只会看到最相关的点。
It’s easy to imagine this coming in handy. Did you forget how to upgrade packages in Ubuntu? Just type tldr apt-get
.
很难想象这会派上用场。 您是否忘记了如何在Ubuntu中升级软件包? 只需输入tldr apt-get
。
Or maybe you can’t quite remember how to unmount drives using diskutil on macOS:
或者,也许您不太记得如何在macOS上使用diskutil卸载驱动器:
You get the idea: it’s a quick way to look up what almost any command does. I coudln’t find many common commands that weren’t supported, but if you do to learn how to submit your own summaries.
您有一个主意:这是查找几乎所有命令所执行操作的快速方法。 我找不到很多不受支持的常用命令,但是如果您确实以了解如何提交自己的摘要。
Installing tldr on macOS is easy using . Install Homebrew, then use the command brew install tldr
and you’re done. You can start using tldr right away!
使用可以轻松地在macOS上安装tldr。 安装Homebrew,然后使用命令brew install tldr
完成。 您可以立即开始使用tldr!
I had a little bit more trouble on Ubuntu, because as of this writing, tldr isn’t offered in any repository. But it’s not hard to get this working with a little work.
我在Ubuntu上遇到了更多麻烦,因为在撰写本文时,任何存储库中都未提供tldr。 但是,不费吹灰之力就可以完成此工作。
First, install NodeJS and the Node Package Manager (nps):
首先,安装NodeJS和Node Package Manager(nps):
sudo apt install nodejs npm
Next use npm to install tldr:
接下来使用npm安装tldr:
sudo npm install -g tldr
You should now be able to use tldr, but I had trouble on Ubuntu 16.04: I saw an error about there being “no such file or directory” as node. The solution was to create a symlink:
现在您应该可以使用tldr了,但是我在Ubuntu 16.04上遇到了麻烦:我看到关于“没有这样的文件或目录”作为节点的错误。 解决方案是创建一个符号链接:
sudo ln -s /usr/bin/nodejs /usr/bin/node
Do that and tldr should be up and running in Ubuntu. As always, these steps may vary depending on which Linux distribution you’re using.
这样做,tldr应该在Ubuntu中启动并运行。 与往常一样,这些步骤可能会因您所使用的Linux发行版而异。
Using tldr from the command prompt makes sense, because that’s the place where you type your commands. But it’s not necessary: there’s a great web version at , and it’s worth bookmarking if you can’t manage to install the above versions.
在命令提示符下使用tldr很有意义,因为这是您键入命令的地方。 但这不是必需的: 有一个很棒的Web版本,如果您无法安装上述版本,则值得添加书签。
There’s even an edit link, just in case you see a mistake. Enjoy!
甚至还有一个编辑链接,以防万一您看到一个错误。 请享用!
翻译自:
tldr
转载地址:http://imzwd.baihongyu.com/