Collaborative cheatsheets for console commands.
https://tldr.sh/
What is tldr-pages?
The tldr-pages project is a collection of community-maintained help pages for command-line tools, that aims to be a simpler, more approachable complement to traditional man pages.
Maybe you are new to the command-line world? Or just a little rusty? Or perhaps you can't always remember the arguments to lsof, or tar?
It certainly doesn't help that the first option explained in man tar is:
-b blocksize
Specify the block size, in 512-byte records, for tape drive I/O.
As a rule, this argument is only needed when reading from or writing to tape drives,
and usually not even then as the default block size of 20 records (10240 bytes) is very common.
There seems to be room for simpler help pages, focused on practical examples.
This repository is just that: an ever-growing collection of examples for the most common UNIX, Linux, macOS, SunOS and Windows command-line tools.
How do I use it?
A popular and convenient way to access these pages on your computer is to install the Node.js client, which is supported by the tldr-pages project maintainers:
npm install -g tldr
You can also use the fully-featured official Python client which can be installed via pip3.
pip3 install tldr
That way you can write tldr tar in the terminal to show the tldr page for tar, just like you would write man tar to show its manpage.
However, if you just want to browse without installing anything, check out the PDF version.
There are also various other clients provided by the community, both for the command-line and for other platforms. For a comprehensive list of clients, head over to our Wiki.
Similar projects
Bro pages are a highly readable supplement to man pages. Bro pages show concise, common-case examples for Unix commands. The examples are submitted by the user base, and can be voted up or down; the best entries are what people see first when they look up a command.
Cheat allows you to create and view interactive cheatsheets on the command-line. It was designed to help remind *nix system administrators of options for commands that they use frequently, but not frequently enough to remember.
cheat.sh Aggregates cheat sheets from multiple sources (including tldr-pages) into 1 unified interface.
devhints Rico's cheatsheets are not just focused on the command-line and include a plethora of other cheatsheets related to programming.
eg provides detailed examples with explanations on the command-line. Examples come from the repository, but
egsupports displaying custom examples and commands alongside the defaults.kb is a minimalist command-line knowledge base manager. kb can be used to organize your notes and cheatsheets in a minimalist and clean way. It also supports non-text files.
navi is an interactive cheatsheet tool, which allows you to browse through specific examples or complete commands on the fly.
What does "tldr" mean?
TL;DR stands for "Too Long; Didn't Read". It originated as Internet slang, where it is used to indicate that a long text (or parts of it) has been skipped as too lengthy. Read more in How-To Geek's article.
from https://github.com/tldr-pages/tldr
----
tldr pages clients
The content of tldr pages is openly available under the permissive MIT License. It can be accessed directly by downloading the contents of this repository (there's a regularly updated archive available here), visiting the command pages individually on github.com — for example, here's the page for the tar command — or downloading the PDF version.
For a more convenient access, though, several dedicated client applications have been developed for different platforms:
Web clients
| Author | Source code | Where to find it |
|---|---|---|
| @ostera | tldr.jsx | Available online at tldr.ostera.io |
| @finzzz | tldr.finzzz.net | Available online at https://tldr.finzzz.net/ |
| @TheAshwanik | tldr-Jquery-client | Available online at blog.ashwani.co.in/tldr-Jquery-client |
| @hill | tldr-chrome | [Discontinued] Browser extension for Google Chrome |
| @piraces | tldr-extension-browser | Browser extension, published in the stores for Google Chrome, Firefox, Edge and other Chromium based browsers |
| @duckduckgo | tldr_pages | Sidebar shown on searches such as "tldr tar" on the DuckDuckGo search engine |
| DistroWatch | (unavailable) | Available online at distrowatch.com/dwres.php?resource=man-pages |
| @opoet7 | tldr-persian | Available online at https://opoet7.github.io/tldr-persian/ |
Console clients
The original client
The Node.js client was the client that was originally bundled with the tldr-pages project. It has since been moved to a separate repository, but remains actively supported by the maintainers of the tldr-pages project. It is available on NPM and can be installed by running npm install -g tldr.
The Node.js client has also been packaged as a Docker container (alias tldr='docker run --rm -it -v ~/.tldr/:/root/.tldr/ nutellinoit/tldr').
Other console clients
| Client | Implementation details | Installation instructions |
|---|---|---|
| accatyyc / tldr-man | man | Instructions on the README |
| unInstance / untldr | C99 | make install |
| anoopengineer / tldr | Go | go get github.com/anoopengineer/tldr(or Download binaries for Windows, MacOSX and Linux) |
| avih / tldr-fmt | POSIX Shell | git clone https://github.com/avih/tldr-fmt |
| brainmaestro/tldr-php | PHP | composer global require brainmaestro/tldr |
| dbrgn / tealdeer | Rust | cargo install tealdeerAUR: yay -S tealdeer |
| tldr-pages / extldr | Elixir | Instructions on the README |
| edgurgel / tldr_elixir_client | Elixir | binaries not yet available |
| hterkelsen / tldr | Dart | pub global activate tldr |
| isacikgoz / tldr | Go | go get github.com/isacikgoz/tldr/cmd/tldr |
| k3mist / tldr | Go | go get bitbucket.org/djr2/tldr(or Downloads (OSX, Linux, Windows)) |
| kirillseva / tldrrr | R | devtools::install_github('kirillseva/tldrrr') |
| lord63 / tldr.py | Python | pip install tldr.py |
| pepa65 / tldr-bash-client | Bash | bpkg install pepa65/tldr |
| porras / tlcr | Crystal | brew install porras/tap/tlcr |
| pranavraja / tldr | Go | go get github.com/pranavraja/tldr(or platform binaries) |
| principis / tldr-sharp | C# | platform packages or instructions in README |
| psibi / tldr-hs | Haskell | stack install tldr |
| raylee / tldr-sh-client | POSIX Shell | installation via curl or manually saving the script |
| rilut / rust-tldr | Rust | cargo install tldr |
| RosalesJ / tldr-ocaml | OCaml | opam install tldr |
| skaji / perl-tldr | Perl | cpanm App::tldr |
| tldr-pages / tldr-c-client | C | Homebrew: brew install tldrMacports: port install tldr-cpp-client |
| tldr-pages / tldr-python-client | Python | pip install tldrArchLinux: pacman -S tldr |
| ve-nt / outfieldr | Zig | Instructions in the README |
| YellowApple / tldrb | Ruby | gem install tldrb |
| HardDie / myTldr | Go | go get github.com/HardDie/myTldr(or platform binaries) (supports custom pages directories) |
| marchersimon/tldr-cpp | C++ | yay -S tldr-cpp-git |
| iamgodot/py-tldr | Python | pip install py-tldr |
| azraeljd/tldr-bash | Bash | Instructions on the README |
| eqf0 / mt | Nim | nimble install mt |
Mobile clients
| Client | Platform | Installation instructions |
|---|---|---|
| Techno-Disaster / tldr man-pages | Android | tldr man-pages on Google Play, and F-Droid |
| hidroh / tldroid (outdated) | Android | tldroid on Google Play |
| freesuraj / TLDR | iOS | TLDR Man Page in App Store |
| mflint / ios-tldr-viewer | iOS | tldr-pages in App Store |
Desktop clients
| Client | Platform | Installation instructions |
|---|---|---|
| terenceng2010/tldr-electron | Linux, macOS, Windows | electron-packaged binaries at https://github.com/terenceng2010/tldr-electron |
Application integration
| Application | Language | Source code | Installation instructions |
|---|---|---|---|
| Alfred | Go | konoui / alfred-tldr | Instructions on the README |
| Alfred | Python | cs1707 / tldr-alfred | |
| Dash for macOS / Zeal | Python | Moddus / tldr-python-dash-docset | open Preferences > Downloads > User Contributed and find tldr pages in the list |
| Emacs | Emacs Lisp | kuanyui / tldr.el | tldr.el is now available on MELPA |
| Slack | Rust | tldr-slack-bot | Add a bot user to workspace, obtain API key, compile repository with cargo and execute. |
| Telegram | JavaScript | tldr-telegram | Add the bot on Telegram or follow the installation instructions. |
| Keypirinha | Python | keypirinha-tldr | Follow the installation instructions on the readme page. |
| Discord | C# | Epictek/tldr-Discord | |
| Dendron | JavaScript | kevinslin/seed-tldr | Install Dendron (VS Code extension), then follow the Quickstart to add the dendron.tldr vault |
| Rust/Coreutils | Rust | uutils/coreutils | Coreutils written in Rust documentations uses tldr for the doc. example |
from https://github.com/tldr-pages/tldr/wiki/tldr-pages-clients
-----
Node.js command-line client for tldr pages.
tldr-node-client
A Node.js based command-line client for tldr.
tldr-node-client's output for the tar page, using a custom color theme
Installing
npm install -g tldrUsage
To see tldr pages:
tldr <command>show examples for this commandtldr <command> --os=<platform>show command page for the given platform (linux,osx,sunos,windows)tldr --search "<query>"search all pages for the querytldr --linux <command>show command page for Linuxtldr --osx <command>show command page for OSXtldr --sunos <command>show command page for SunOStldr --windows <command>show command page for Windowstldr --listshow all pages for current platformtldr --list-allshow all available pagestldr --randomshow a page at randomtldr --random-exampleshow a single random exampletldr --markdownshow the original markdown format page
The client caches a copy of all pages locally, in ~/.tldr. There are more commands to control the local cache:
tldr --updatedownload the latest pages and generate search indextldr --clear-cachedelete the entire local cache
As a contributor, you might also need the following commands:
tldr --render <path>render a local page for testing purposes
Tldr pages defaults to showing pages in the current language of the operating system, or English if that's not available. To view tldr pages for a different language, set an environment variable LANG containing a valid POSIX locale (such as zh, pt_BR, or fr) and then run the above commands as usual. In most *nix systems, this variable will already be set.
It is suggested that the LANG environment variable be set system-wide if this isn't already the case. Users without sudo access can set it locally in their ~/.profile.
LANG=zh tldr <command>
For the list of available translations, please refer to the main tldr repo.
Configuration
You can configure the tldr client by adding a .tldrrc file in your HOME directory. You can copy the contents of the config.json file from the repo to get the basic structure to start with, and modify it to suit your needs.
The default color theme is the one named "simple". You can change the theme by assigning a different value to the "theme" variable -- either to one of the pre-configured themes, or to a new theme that you have previously created in the "themes" section. Note that the colors and text effects you can choose are limited. Refer to the chalk documentation for all options.
{
"themes": {
"ocean": {
"commandName": "bold, cyan",
"mainDescription": "",
"exampleDescription": "green",
"exampleCode": "cyan",
"exampleToken": "dim"
},
"myOwnCoolTheme": {
"commandName": "bold, red",
"mainDescription": "underline",
"exampleDescription": "yellow",
"exampleCode": "underline, green",
"exampleToken": ""
}
},
"theme": "ocean"
}If you regularly need pages for a different platform (e.g. Linux), you can put it in the config file:
{
"platform": "linux"
}The default platform value can be overwritten with command-line option:
tldr du --os=osxAs a contributor, you can also point to your own fork containing the tldr.zip file. The file is just a zipped version of the entire tldr repo:
{
"repository": "http://myrepo/assets/tldr.zip"
}By default, a cache update is performed anytime a page is not found for a command. To prevent this behavior, you can set the configuration variable skipUpdateWhenPageNotFound to true (defaults to false):
{
"skipUpdateWhenPageNotFound": true
}Command-line Autocompletion
Currently we only support command-line autocompletion for zsh and bash. Pull requests for other shells are most welcome!
zsh
It's easiest for oh-my-zsh users, so let's start with that.
mkdir -p $ZSH_CUSTOM/plugins/tldr
ln -s bin/completion/zsh/_tldr $ZSH_CUSTOM/plugins/tldr/_tldr
Then add tldr to your oh-my-zsh plugins, usually defined in ~/.zshrc, resulting in something looking like this:
plugins=(git tmux tldr)
Alternatively, using zplug
zplug "tldr-pages/tldr-node-client", use:bin/completion/zsh
Fret not regular zsh user! Copy or symlink bin/completion/zsh/_tldr to my/completions/_tldr (note the filename). Then add the containing directory to your fpath:
fpath = (my/completions $fpath)
Bash
ln -s bin/completion/bash/tldr ~/.tldr-completion.bash
Now add the following line to our bashrc file:
source ~/.tldr-completion.bash
FAQ
Installation Issues
- If you are trying to install as non-root user (
npm install -g tldr) and get something like:
Error: EACCES: permission denied, access '/usr/local/lib/node_modules/tldr'
Then most probably your npm's default installation directory has improper permissions. You can resolve it by clicking here
- If you are trying to install as a root user (
sudo npm install -g tldr) and get something like:
as root ->
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/tldr/node_modules/webworker-threads/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/tldr/node_modules/webworker-threads/.node-gyp/8.9.1"
You need to add the option --unsafe-perm to your command. This is because when npm goes to the postinstall step, it downgrades the permission levels to "nobody". Probably you should fix your installation directory permissions and install as a non-root user in the first place.
- If you see an error related to
webworker-threadslike:
/usr/local/lib/node_modules/tldr/node_modules/natural/lib/natural/classifiers/classifier.js:32
if (e.code !== 'MODULE_NOT_FOUND') throw e;
Most probably you need to reinstall node-gyp and webworker-threads. Try this -
sudo -H npm uninstall -g tldr
sudo -H npm uninstall -g webworker-threads
npm install -g node-gyp
npm install -g webworker-threads
npm install -g tldr
For further context, take a look at this issue
from https://github.com/tldr-pages/tldr-node-client
----
https://tldr.sh/assets/tldr-book.pdf

No comments:
Post a Comment