Signup/Sign In

"TLDR" For simplifying Man Pages in Linux

Posted in Programming   MAY 30, 2023

    If you are new to the Linux commands and want to learn the commands, depending on the authors you sometimes find a good tutorial on the command; you might get a little better than a list of the flags; sometimes you don't even get that. Here comes the big help from the man pages.
    Man pages are brilliantly useful for remembering what do each flag does.

    For example, take the sar command. Man pages are not much found to be useful when you encounter a command for the first time, but they're often useful for finding related commands or config files. They, of course, get easier to read.

    About Linux man-pages:

    Man pages are just manuals are the online software documentation for Unix and Linux-like operating systems. Dennis Ritchie and Ken Thompson wrote the man pages in November 1971. They are written in English and translated into other languages that are available on your system.

    We can see an example of a man page below:

    man pages
    Here is the description of the details that are contained in man pages.

    • The Syntax of the Unix/Linux command, including the list of arguments to use with the command.
    • The description of a particular command and information about how to use it.
    • Some example usages
    • List of related commands or functions
    • Information about the author of the command
    • Copyright section, etc.

    Some Useful commands when using the Man pages:

    • If you want to navigate through the man pages, use the up and down arrow keys.
    • If you want to reach the end of a man page, press shift + g could help you.
    • If you want to quit a man page, just type q. The page automatically closes.

    TLDR pages:

    TLDR pages are just like man pages. The name TLDR comes from the Internet slang “Too Long; Didn’t Read”. It has a simple, concise version of Unix and Linux man pages.

    It is a collection of simplified, and community-driven man pages. Unlike the man pages, TLDR displays only the command description with simple practical examples, so the burden of navigating through the entire man page to find any command examples will be reduced. TLDR collection of examples includes most of UNIX, Linux, OSX, Sun OS, and Windows commands.
    In this article, let take a look at how to install TLDR and use TLDR on Linux.

    Install TLDR on Linux:

    First we need to install Node.js or python3, for this run:

    $ sudo apt install python3 python3-pip
    $ sudo apt install nodejs npm


    In RPM-based systems:

    $ sudo yum install epel-release
    $ sudo yum install nodejs npm


    Our next task is to install the TLDR command. To install TLDR, we use the command:

    $ sudo npm install -g tldr
    $ sudo pip3 install tldr

    Usage of TLDR Command:


    The usage is similar to man pages.

    Let us start with the help page, To display the help page run

    $ tldr –help

    Tldr help

    The above page displays you with all the help commands


    Now, To display the documentation for the ls command, run:

    $ tldr ls

    Sample output:

    ls
     List directory contents.
    - List files one per line:
     ls -1
    - List all files, including hidden files:
     ls -a
    - Long format list 
     ls -la
    - Long format list with size 
     ls -lh
    - Long format list sorted by size (descending):
     ls -lS
    - Long format list of all files, sorted by modification date (oldest first):
     ls -ltr


    To display the tar command documentation, run:

    $ tldr tar

    tldr tar

    Conclusion:

    As shown in the above outputs, TLDR displays only the command descriptions and few examples of it. There will be no unwanted results such as description, arguments/options, author details, copyright information. The users can easily find what exactly the command does with simple examples, unlike the normal man pages.


    That’s what about the brief on the tldr command and the command finds more useful upon using it more, and with this, you could learn more about what the commands can do in-depth.

    Hope this guide will help you!!

    About the author:
    Tags:command-linecommandslinux
    IF YOU LIKE IT, THEN SHARE IT
     

    RELATED POSTS