The Linux man (or manual) pages are a fantastic resource. They contain detailed usage for commands, including all of their options and usages. The problem with man pages is that they may offer too much information. What if you're already familiar with a command and just trying to remember which option you need to complete a specific task?

That's where tldr comes in handy. This tool's name comes from the acronym (or initialism) TL;DR, which stands for too long; didn't read. It's internet slang for a summary of a long text. In the same spirit, the tldr command-line tool summarizes a lengthy man page and consists mainly of examples.

What is the tldr command?

The tldr command-line tool is a client for the community tldr pages project. Instead of searching through pages and pages of information until you find the option you're looking for and perhaps reading how to use it, type tldr {command} to get a short list of the most common uses for that command. Chances are, you'll get what you need.

For example, the man page for the find command consists of over 1,100 lines. The tldr for find has just 30 lines, including eight practical examples:

$ tldr find

  find

  Find files or directories under the given directory tree, recursively.
  More information: https://manned.org/find.

  - Find files by extension:
    find root_path -name '*.ext'

  - Find files matching multiple path/name patterns:
    find root_path -path '**/path/**/*.ext' -or -name '*pattern*'

  - Find directories matching a given name, in case-insensitive mode:
    find root_path -type d -iname '*lib*'

  - Find files matching a given pattern, excluding specific paths:
    find root_path -name '*.py' -not -path '*/site-packages/*'

  - Find files matching a given size range:
    find root_path -size +500k -size -10M

  - Run a command for each file (use `{}` within the command to access the filename):
    find root_path -name '*.ext' -exec wc -l {} \;

  - Find files modified in the last 7 days and delete them:
    find root_path -daystart -mtime -7 -delete

  - Find empty (0 byte) files and delete them:
    find root_path -type f -empty -delete

This tool is not a replacement for the man command. The man pages are still the canonical and complete source of information for a Linux command. tldr is a nice complement that provides, at a glance, focused details to help you to get something done quickly.

Install tldr

The tldr project provides two versions of the client: Node.js and Python. Fedora Linux packages the Python client in the official repository, so you can install it using dnf:

$ sudo dnf -y install tldr

Install it on other Linux distributions using npm or pip3. For more information, consult the project repository.

[ Download now: Linux commands cheat sheet. ]

Use tldr offline

The tldr tool typically requires internet access to consult the tldr pages. The Python client available in Fedora supports downloading and caching these pages for offline access. To do this, run tldr with the -u option:

$ tldr -u
Updated cache for 3239 entries

Now you can use tldr when you're disconnected from the internet.

[ Get the guide to installing applications on Linux. ]

What's next?

The tldr pages are a community effort. Not all commands are available, but more commands are added regularly. You can help improve the existing examples or add missing commands to the project. For more information, consult the project's contribution guidelines.

For more information about tldr, you can always use tldr tldr.


关于作者

Ricardo Gerardi is a Principal Consultant at Red Hat, having transitioned from his previous role as a Technical Community Advocate for Enable Sysadmin. He's been at Red Hat since 2018, specializing in IT automation using Ansible and OpenShift.


With over 25 years of industry experience and 20+ years as a Linux and open source enthusiast and contributor, Ricardo is passionate about technology. He is particularly interested in hacking with the Go programming language and is the author of Powerful Command-Line Applications in Go and Automate Your Home Using Go. Ricardo also writes regularly for Red Hat and other blogs, covering topics like Linux, Vim, Ansible, Containers, Kubernetes, and command-line applications.


Outside of work, Ricardo enjoys spending time with his daughters, reading science fiction books, and playing video games.

UI_Icon-Red_Hat-Close-A-Black-RGB

按频道浏览

automation icon

自动化

有关技术、团队和环境 IT 自动化的最新信息

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

open hybrid cloud icon

开放混合云

了解我们如何利用混合云构建更灵活的未来

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Virtualization icon

虚拟化

适用于您的本地或跨云工作负载的企业虚拟化的未来