Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

Linux command line helpers: Tools to compensate for Linux man pages weaknesses and the lack of examples

News Unix Sysadmin Tips Recommended Links Linux command line helpers Sysadmin cheatsheets Unix System Monitoring Job schedulers Systemd Cheatsheet
Saferm -- wrapper for rm command PDSH -- a parallel remote shell Creation of a editable knowledgebase of examples for major Linux utilities TeraTerm Macros  Linux implementation of sar Unix Configuration Management Tools Perl Admin Tools and Scripts Baseliners
Bash Tips and Tricks WinSCP Tips Attaching to and detaching from screen sessions Midnight Commander Tips and Tricks WinSCP Tips Linux netwoking tips RHEL Tips Suse Tips
Filesystems tips Shell Tips How to rename files with special characters in names VIM Tips GNU Tar Tips GNU Screen Tips AWK Tips Linux Start up and Run Levels
Unix System Monitoring Job schedulers  Grub Simple Unix Backup Tools  Sysadmin Horror Stories History Humor Etc

Introduction

As it is  impossible to remember option for the most of linux command we use. There too many command and too many option. That leads to brain overflow when newer information displaces the old :-)

There are three application which can help by providing a concise information with examples -- tldr, eg and cheat. And examples are the weak spot of Linux man pages -- many utilities do not have examples section at all and those that have most often have a very low quality of examples.

An open issue is how to integrate all three into a single package. One approach is to extend code in eg to accept formatting of tldr. The other is to modify tldr client to allow direct editing pages. Say, via option -e. In any case without smooth method of modification of pages to suit your own experience the value of those pages is less. Of course, you can write your own client.

The three tools mentioned above vary in the scope of example with tldr having the most examples, and eg the least. They also vary in their ability to customize examples -- only eg provides -e option which allows to create your own page and edit it.

Of course such simple utilities can be written in any scripting language of your choice but most common are Python, Javascript, and  Golang.  The logic is trivial:

Get full path to the helper page request; abort if it does not exist;

Open file with helper page; 
While not EOF {
  get line
  colorize line
  print line
}
NOTE: tldr client actually has a specification that you should follow.  See tldr-CLIENT-SPECIFICATION.md at v1.5 · tldr-pages-tldr

tldr

tldr stands for too long didn’t read, it is a set of community-written examples to common Linux utilities written in a subset of Markdown. It presuppose the existence of the central web site with the examples, where you get individual pages from, but some clients (for example Python client) can operate with the local directory with the pages (Python client allows to use file:///path/to/directory)

This project contains the largest collection of examples to linux man pages (over six hundred entries). As such it is the largest  database of examples for Linux manpages.

As pages are accessed from the web server this tool is more suitable for centralized deployment in the organization, or a cluster. Client for tldr clients do not provide page-editing capabilities and customarization of pages for specific uses. You have a web server and all pages reside in it. Of cause you can implement git and scripts to allow retrieval and editing of Markdown pages. 

It is possible to use it without installation, directly from the web via website https://tldr.ostera.io. You can also install it to be available on the command line. In this case you need a client.

Clients are available is many popular languages. including  bash, Perl, C, Python, GO and Javascript. There is formal client specification tldr-CLIENT-SPECIFICATION.md at v1.5 · tldr-pages-tldr 

Among the most popular:

By default, the client needs to be pointed to a web site with tldr pages. For example tldr-pages  on GitHub. If you client supports local pages they can be downloaded and installed in suitable directory too.

Not only Linux utilities pages are covered. TLDR client for Android (useful for android developers and users) is downloadable  from Google Play Store.

eg

A simple Python script eg is another, different from tlrd,  simple lister/pager for the collection of examples for Unix utilities. It is suitable for creating the private knowledge base as it contains option -e which allows you to edit pages. It is also a  better name -- shorter and more mnemonic.  The source code downloadable from the  Eg GitHub Repository.  

Unfortunately the format of pages with examples is different from tldr but still is a subset of Markdown; eg also can satisfactory render tldr pages.

Since 2016 the project is in hibernation and can be viewed as abandonware. But still the script works, and is useful as a personale knoledgebase.  As it  does not use the web it si also suitable for environments with proxy for which local pages are preferable. 

That of course does not mean that you configure the tldr Python viewer to do the same. You can. Another minor advantage is the presence of -e option, which allows to edit pages in the command line editor of your choice. Of course, it is easy to implement this functionality separately using a simple bash script.  Still eg might be interesting for people who not only want to consult examples provided with the particular utility, but want to create and gradually enhance the set of your own examples extracted from bash command history. 

Along with the ability to edit pages you view via option -e (whch makes it closer to the idea of a custom knowledgebase) then tldr two alternatives that we discuss here.

Unlike tldr Python client, it does not  have the advantage of the simple code base: it is bloated and can be viewed as a typical case of "Python spaghetti" with too many small subroutines, which increase the size of the codebase while providing little or no help in understanding and maintaining the program.  The size of codebase is probably four times more then it should be and can be cut to half without any loss of functionality.

# wc -l *py
  102 color.py
  636 config.py
  191 core.py
   27 eg_exec.py
    0 __init__.py
    4 __main__.py
   40 substitute.py
  392 util.py
 1392 total

One would expect 200-300 lines of codes for such a simple client, not something over 1K (truth be told the half of the codebase are in config.py and it can be easily simplified. But the structure of core.py, util.py and color.py is also boated with many redundant subs. I would recommend to merge them in a single script and remove redundancies and functionality that that you do not need (aliases, etc). Anything above 500 lines for such a simple utility is a travesty ;-) 

As I mentioned above,  helper pages for eg are written in the extremely basic subset of markdown and are displayed with colorization, which is the only transformation performed for output. 

Disadvantage here is the the subset used is different from tldr. But the basic format is similar and one can ither change the code to access tldr format, or a converter from one format to another.

It can be installed using Pip package manager. You can also install it from zip file, which is an option if you are behind proxy.

Standard examples provided by eg ( around 60 examples) are of various quality (the list is available via eg --list) and they do not cover "tough spots" and many important utilities such as systemctl.  In other words they are little more than inspiration to create something better, more suitable for your particular need. So the extension to tldr format is probably the first thing that one should try so that you can use tldr pages instead.  That involves changing color.py

Like tldr client you need to provide the name of the command, for example grep, to display examples, if any:

eg grep

To accommodate custom pages without destroying default examples eg uses a special directory which you need to create before you can created your custom pages. You also need a configuration file that points to it and the directory with the default set of example

Additionally the script below expects that you downloaded pages from tldr and the file  are also downloaded and the file tldr-master.zip is present. They will installed into "custom" directory of eg. They provide much broader spectrum of Linux command then original eg helper pages.

Alias eg need to be added to your .bash_profile or to .bashrc, depending on how your dot files are organized.

Below an installation script that implements proposed customarization with tldr files.

To create a private knowledgebase of examples that uses the suggested above format with set of tldr pages as the initial content of the knowledgebase, you need first to download two zip files from GitHub eg-master.zip and tldr-main.zip to your home directory. For enterprise users that also allows to avoid pains with proxy.

After that run the following installation script. Alias eg needs to be added to your .bash_profile or to .bashrc, depending on how your dot files are organized. The script adds it .bash_profile which might be incorrect.

[0]root@d620: # cat  eg_install.sh
#!/bin/bash
#: eg_install.sh: install eg and populate custom and example directories from tldr files and original eg files correspondingly
#: Copyright Nikolai Bezroukov, 2021. Perl Artistic License.
#:
#: Invocation:
#: eg_install.sh 
#
# ====================================================================================
# 1.0 bezroun 2021/05/03 Initial implementation
# 1.1 bezroun 2021/05/04 Diagnostics improved. Logging of steps added
#======================================================================================
VERSION='1.1'
step_no=1

function sanity_chk
{
if [[ $1 == 'd' ]] && [[ ! -d $2 ]]; then 
echo "[FAILURE] $3"; exit $4; 
elif [[ $1 == 'f' ]] && [[ ! -f $2 ]]; then
echo "[FAILURE] $3"; exit $4; 
fi 
}
function success
{
printf "[OK] Step $step_no: $current_step\n==========================================================================================\n";
sleep 3
}
function step
{
printf "\nStep $step_no: $1\n" 
current_step=$1
(( step_no++ ))
}

printf "\nEg_installer Version $VERSION " `date +"%y/%m/%d %H:M:"`
echo
cd
if [[ -f ~/eg-master.zip && -f ~/tldr-main.zip ]]; then
echo "Both required zip files eg-master.zip and tldr-main.zip are present. We can proceed with the installation"
else
echo "The script requires that files eg-master.zip and tldr-main.zip to be present in your home directory. Exiting..." 
exit 255
fi 

step "Unziping ~/eg-master.zip and moving ~/eg-master/eg it to ~/bin/eg"
mkdir -p ~/.eg/Ex0 # create both .eg and .eg/Ex0
sanity_chk d ~/.eg/Ex0 "Failed to create ~/.eg/Ex0" 1
unzip ~/eg-master.zip
[[ ! -d ~/bin ]] && mkdir ~/bin
mv ~/eg-master/eg ~/bin/eg; 
sanity_chk d ~/bin/eg "Failed to move ~/eg-master/eg to ~/bin" 1
mv ~/eg-master/eg_exec.py ~/bin
success

step "Creating .egrc file"
cat > ~/.egrc <<EOF
[eg-config]
examples-dir = ~/.eg/Ex1
custom-dir = ~/.eg/Ex0
EOF
sanity_chk f ~/.egrc "Failed to create ~/.egrc" 2
success

step "Move examples from eg and tldr to directories specified in .egrc"
mv ~/bin/eg/examples ~/.eg/Ex1; sanity_chk d ~/.eg/Ex1 "Failed to move ~/bin/eg/examples ~/.eg/Ex1" 3 
unzip ~/tldr-main.zip
mv ~/tldr-main/pages ~/.eg/Ex0; sanity_chk d ~/.eg/Ex0 "Failed to move ~/tldr-main/pages ~/.eg/Ex0" 3 
success

step "[Optional] Create aliases for the command"
alias eg='~/bin/eg_exec.py' >> ~/.bash_profile # alias for running the command
alias eeg='~/bin/eg_exec.py -e' >> ~/.bash_profile # alias for editing custom examples
success

echo "Test if the installation was successful. if necessary modules are missing install them"
~/bin/eg_exec.py ls

rm -r ~/tldr-main ~/eg-master
echo
echo "End of eg_install.sh run" `date +"%Y/%m/%d %H:M:"`

Now you can edit any command and modify pages you downloaded from tldr making them custom. Edited file will go to your custom directory.  For example:

eg -e grep

cheat

Cheat is another attempt to provide a useful set of example to manpages. It was written by  Chris Allen Lane, and as of April 2021 is still maintained by  the same author.  One advantage of this solution is that author abandoned Python and rewrote the script in GOlang, which suggests higher quality that usual for the codebase.

It allows you to create and view interactive Linux/Unix commands cheatsheets on the command-line. Unlike previous utilities it allows to have a set of directories with the cheatsheet and the order in which they are looked at can be changed.

Like previous two utilities the main idea is help *nix system administrators with examples and options for commands that they use periodically, but not frequently enough to remember.

The initial set of cheatsheet written by Chris Allen Lane is available from GitHub - cheat-cheatsheets- Community-sourced cheatsheets It contains around 200 examples. The structure of cheatsheets is more advanced then in previous two utilities: each cheatsheet consist of the header and  the body. The header is optional and can contain tags.

Initially it was written in Python. Recently it was completely rewritten in Golang. which is, of course, the implementation  superior to Python as it does not have any dependencies.

Once installed, you can retrieve the page you are interested in by providing the name as the parameter (e.g. cheat systemcfg ). Upon first run, cheat will ask you if you would like to create a config file and download the community cheatsheets. More info on cheat can be found on Github. Cheat utility is also available snap package. If you Linux system has Snapd installed, run the following command to install cheat:

$ sudo snap install cheat

Cheatsheets are plain-text files with no file extension, and are named according to the command used to view them:

cheat tar     # file is named "tar"
cheat foo/bar # file is named "bar", in a "foo" subdirectory

Cheatsheet text may optionally be preceded by a YAML header that assigns tags and specifies syntax:

---
syntax: javascript
tags: [ array, map ]
---
// To map over an array:
const squares = [1, 2, 3, 4].map(x => x * x);

Cheatpaths

Cheatsheets are stored on "cheatpaths", which are directories that contain cheatsheets. Cheatpaths are specified in the conf.yml file.

It can be useful to configure cheat against multiple cheatpaths. A common pattern is to store cheatsheets from multiple repositories on individual cheatpaths:

# conf.yml:
# ...
cheatpaths:
  - name: community                   # a name for the cheatpath
    path: ~/documents/cheat/community # the path's location on the filesystem
    tags: [ community ]               # these tags will be applied to all sheets on the path
    readonly: true                    # if true, `cheat` will not create new cheatsheets here

  - name: personal
    path: ~/documents/cheat/personal  # this is a separate directory and repository than above
    tags: [ personal ]
    readonly: false                   # new sheets may be written here
# ...

The readonly option instructs cheat not to edit (or create) any cheatsheets on the path. This is useful to prevent merge-conflicts from arising on upstream cheatsheet repositories.

If a user attempts to edit a cheatsheet on a read-only cheatpath, cheat will transparently copy that sheet to a writeable directory before opening it for editing.

Directory-scoped Cheatpaths

At times, it can be useful to closely associate cheatsheets with a directory on your filesystem. cheat facilitates this by searching for a .cheat folder in the current working directory. If found, the .cheat directory will (temporarily) be added to the cheatpaths.

Manly and explainshell

Manly, is a commenter on your commands explaining options used. It is a command line alternative to the Web service at  explainshell.com. It is written in Python, so you can install it using Pip package manager:

$ pip install --user manly

If you give it an example of linux command, it will try to comment it explaining the meaning of options:

$ manly df -h

Checking the command before executing it can help to prevent blunders when you think that a particular option means one thing while in reality it means another.


Top Visited
Switchboard
Latest
Past week
Past month


NEWS CONTENTS

Old News ;-)

[Jun 26, 2021] Replace man pages with Tealdeer on Linux - Opensource.com

Jun 22, 2021 | opensource.com

Replace man pages with Tealdeer on Linux Tealdeer is a Rust implementation of tldr, which provides easy-to-understand information about common commands. 21 Jun 2021 Sudeshna Sur (Red Hat, Correspondent) Feed 10 up Image by : Opensource.com x Subscribe now

Get the highlights in your inbox every week.

https://opensource.com/eloqua-embedded-email-capture-block.html?offer_id=70160000000QzXNAA0 More Linux resources

Man pages were my go-to resource when I started exploring Linux. Certainly, man is the most frequently used command when a beginner starts getting familiar with the world of the command line. But man pages, with their extensive lists of options and arguments, can be hard to decipher, which makes it difficult to understand whatever you wanted to know. If you want an easier solution with example-based output, I think tldr is the best option. What's Tealdeer?

Tealdeer is a wonderful implementation of tldr in Rust. It's a community-driven man page that gives very simple examples of how commands work. The best part about Tealdeer is that it has virtually every command you would normally use.

Install Tealdeer

On Linux, you can install Tealdeer from your software repository. For example, on Fedora :

$ sudo dnf install tealdeer

On macOS, use MacPorts or Homebrew .

Alternately, you can build and install the tool with Rust's Cargo package manager:

$ cargo install tealdeer
Use Tealdeer

Entering tldr --list returns the list of man pages tldr supports, like touch , tar , dnf , docker , zcat , zgrep , and so on:

$ tldr --list
2to3
7z
7za
7zr
[
a2disconf
a2dismod
a2dissite
a2enconf
a2enmod
a2ensite
a2query
[ ... ]

Using tldr with a specific command (like tar ) shows example-based man pages that describe all the options that you can do with that command:

$ tldr tar

Archiving utility.
Often combined with a compression method, such as gzip or bzip2.
More information: < https: // www.gnu.org / software / tar > .

[ c ] reate an archive and write it to a [ f ] ile:

tar cf target.tar file1 file2 file3

[ c ] reate a g [ z ] ipped archive and write it to a [ f ] ile:

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 [ v ] erbosely:

tar xvf 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 and write it to a [ f ] ile, using [ a ] rchive suffix to determine the compression program:

tar caf target.tar.xz file1 file2 file3

To control the cache:

$ tldr --update
$ tldr --clear-cache

You can give Tealdeer output some color with the --color option, setting it to always , auto , and never . The default is auto , but I like the added context color provides, so I make mine permanent with this addition to my ~/.bashrc file:

alias tldr='tldr --color always'
Conclusion

The beauty of Tealdeer is you don't need a network connection to use it, except when you're updating the cache. So, even if you are offline, you can still search for and learn about your new favorite command. For more information, consult the tool's documentation .

Would you use Tealdeer? Or are you already using it? Let us know what you think in the comments below.

[May 09, 2021] Good Alternatives To Man Pages Every Linux User Needs To Know by Sk

Images removed. See the original for full text.
Notable quotes:
"... you need Ruby 1.8.7+ installed on your machine for this to work. ..."
| ostechnix.com

1. Bropages

The slogan of the Bropages utility is just get to the point . It is true! The bropages are just like man pages, but it will display examples only. As its slogan says, It skips all text part and gives you the concise examples for command line programs. The bropages can be easily installed using gem . So, you need Ruby 1.8.7+ installed on your machine for this to work. To install Ruby on Rails in CentOS and Ubuntu, refer the following guide: The slogan of the Bropages utility is just get to the point . It is true!

The bropages are just like man pages, but it will display examples only. As its slogan says, It skips all text part and gives you the concise examples for command line programs. The bropages can be easily installed using gem . So, you need Ruby 1.8.7+ installed on your machine for this to work...After After installing gem, all you have to do to install bro pages is:

$ gem install bropages
... The usage is incredibly easy! ...just type:
$ bro find
... The good thing thing is you can upvote or downvote the examples.

As you see in the above screenshot, we can upvote to first command by entering the following command: As you see in the above screenshot, we can upvote to first command by entering the following command:

$ bro thanks
You will be asked to enter your Email Id. Enter a valid Email to receive the verification code. And, copy/paste the verification code in the prompt and hit ENTER to submit your upvote. The highest upvoted examples will be shown at the top. You will be asked to enter your Email Id. Enter a valid Email to receive the verification code. And, copy/paste the verification code in the prompt and hit ENTER to submit your upvote. The highest upvoted examples will be shown at the top.
Bropages.org requires an email address verification to do this
What's your email address?
[email protected]
Great! We're sending an email to [email protected]
Please enter the verification code: apHelH13ocC7OxTyB7Mo9p
Great! You're verified! FYI, your email and code are stored locally in ~/.bro
You just gave thanks to an entry for find!
You rock!
To upvote the second command, type:
$ bro thanks 2
Similarly, to downvote the first command, run:
$ bro ...no

... ... ...

2. Cheat

Cheat is another useful alternative to man pages to learn Unix commands. It allows you to create and view interactive Linux/Unix commands cheatsheets on the command-line. The recommended way to install Cheat is using Pip package manager.,,,

... ... ...

Cheat usage is trivial.

$ cheat find
You will be presented with the list of available examples of find command: ... ... ...

To view help section, run: To view help section, run:

$ cheat -h
For more details, see project's GitHub repository: For more details, see project's GitHub repository: 3. TLDR Pages

TLDR is a collection of simplified and community-driven man pages. Unlike man pages, TLDR pages focuses only on practical examples. TLDR can be installed using npm . So, you need NodeJS installed on your machine for this to work.

To install NodeJS in Linux, refer the following guide. To install NodeJS in Linux, refer the following guide.

After installing npm, run the following command to install tldr. After installing npm, run the following command to install tldr.
$ npm install -g tldr
TLDR clients are also available for Android. Install any one of below apps from Google Play Sore and access the TLDR pages from your Android devices. TLDR clients are also available for Android. Install any one of below apps from Google Play Sore and access the TLDR pages from your Android devices. There are many TLDR clients available. You can view them all here

3.1. Usage To display the documentation of any command, fro example find , run:

$ tldr find
You will see the list of available examples of find command. ...To view the list of all commands in the cache, run: To view the list of all commands in the cache, run:
$ tldr --list-all
...To update the local cache, run: To update the local cache, run: To update the local cache, run:
$ tldr -u
Or, Or,
$ tldr --update
To display the help section, run: To display the help section, run:
$ tldr -h
For more details, refer TLDR github page.4. TLDR++

Tldr++ is yet another client to access the TLDR pages. Unlike the other Tldr clients, it is fully interactive .

5. Tealdeer

Tealdeer is a fast, un-official tldr client that allows you to access and display Linux commands cheatsheets in your Terminal. The developer of Tealdeer claims it is very fast compared to the official tldr client and other community-supported tldr clients.

6. tldr.jsx web client

The tldr.jsx is a a Reactive web client for tldr-pages. If you don't want to install anything on your system, you can try this client online from any Internet-enabled devices like desktop, laptop, tablet and smart phone. All you have to do is just a Web-browser. Open a web browser and navigate to The tldr.jsx is a a Reactive web client for tldr-pages. If you don't want to install anything on your system, you can try this client online from any Internet-enabled devices like desktop, laptop, tablet and smart phone. All you have to do is just a Web-browser. Open a web browser and navigate to Open a web browser and navigate to Open a web browser and navigate to https://tldr.ostera.io/ page.

7. Navi interactive commandline cheatsheet tool

Navi is an interactive commandline cheatsheet tool written in Rust . Just like Bro pages, Cheat, Tldr tools, Navi also provides a list of examples for a given command, skipping all other comprehensive text parts. For more details, check the following link. Navi is an interactive commandline cheatsheet tool written in Rust . Just like Bro pages, Cheat, Tldr tools, Navi also provides a list of examples for a given command, skipping all other comprehensive text parts. For more details, check the following link.

8. Manly

I came across this utility recently and I thought that it would be a worth addition to this list. Say hello to Manly , a compliment to man pages. Manly is written in Python , so you can install it using Pip package manager.

Manly is slightly different from the above three utilities. It will not display any examples and also you need to mention the flags or options along with the commands. Say for example, the following example won't work:

$ manly dpkg
But, if you mention any flag/option of a command, you will get a small description of the given command and its options.
$ manly dpkg -i -R
View Linux
$ manly --help
And also take a look at the project's GitHub page. And also take a look at the project's GitHub page.
Suggested Read: Suggested Read:

[May 05, 2021] eg_install.sh Installation script for eg which allow to reuse tldr pages and edit them creating private knowledgebase with examples of major Linux utilities

It is impossible to remember details of Linux utilities: there are too many of them and some are quite complex (find, xargs, grep, systemctl, etc). To compensate for the low quality on Linux man pages (which typically lack meaningful examples) you can use community database (for example tldr database available from GitHub; it can be viewed using Web browser from ostera.io) or to create a private database of examples, partially or fully extracted from .bash_history. The latter allows to adapt examples to your needs and as such is closer to the idea of a knowledgebase, although one does not exclude another.

I experimented with adaptation for this purpose of Python script eg, available from GitHub and got encouraging results. The idea is to supplement the default set of pages with examples provided with eg with pages from tldr and gradually enhance and edit them by incorporating own examples from .bash history.

The script eg uses two directories for storing the examples files (one for each utility; each written in the subset of Markdown)

  1. custom directory -- the directory in which you can edit files using option -e (for example eg -e find)
  2. default directory -- the directory for the small set of examples which comes with the script.

If pages for the particular tool/utility are present in both, eg merges them creating composite page. So it is possible for example to store your own example in custom directory, and tldr in default directory but I prefer to edit tldr pages directly.

To create a private knowledgebase of examples that uses the suggested above format with set of tldr pages as the initial content of the knowledgebase, you need first to download two zip files from GitHub eg-master.zip and tldr-main.zip to your home directory. That allows to avoid pains with proxy.

After that run the following installation script. Alias eg needs to be added to your .bash_profile or to .bashrc, depending on how your dot files are organized. The script adds it .bash_profile which might be incorrect.

See Admin/Sp_admin_utils/eg_install.shtml and Linux command line helpers for more details

[Apr 22, 2021] TLDR pages- Simplified Alternative To Linux Man Pages That You'll Love

Images removed. See the original for full text.
Apr 22, 2021 | fossbytes.com

The GitHub page of TLDR pages for Linux/Unix describes it as a collection of simplified and community-driven man pages. It's an effort to make the experience of using man pages simpler with the help of practical examples. For those who don't know, TLDR is taken from common internet slang Too Long Didn't Read .

In case you wish to compare, let's take the example of tar command. The usual man page extends over 1,000 lines. It's an archiving utility that's often combined with a compression method like bzip or gzip. Take a look at its man page:

On the other hand, TLDR pages lets you simply take a glance at the command and see how it works. Tar's TLDR page simply looks like this and comes with some handy examples of the most common tasks you can complete with this utility:

Let's take another example and show you what TLDR pages has to offer when it comes to apt:

Having shown you how TLDR works and makes your life easier, let's tell you how to install it on your Linux-based operating system.

How to install and use TLDR pages on Linux?

The most mature TLDR client is based on Node.js and you can install it easily using NPM package manager. In case Node and NPM are not available on your system, run the following command:

sudo apt-get install nodejs
sudo apt-get install npm

In case you're using an OS other than Debian, Ubuntu, or Ubuntu's derivatives, you can use yum, dnf, or pacman package manager as per your convenience.

[Apr 22, 2021] Alternatives of man in Linux command line

Images removed. See the original for full text.
Jan 01, 2020 | www.chuanjin.me

When we need help in Linux command line, man is usually the first friend we check for more information. But it became my second line support after I met other alternatives, e.g. tldr , cheat and eg .

tldr

tldr stands for too long didn't read , it is a simplified and community-driven man pages. Maybe we forget the arguments to a command, or just not patient enough to read the long man document, here tldr comes in, it will provide concise information with examples. And I even contributed a couple of lines code myself to help a little bit with the project on Github. It is very easy to install: npm install -g tldr , and there are many clients available to pick to be able to access the tldr pages. E.g. install Python client with pip install tldr ,

To display help information, run tldr -h or tldr tldr .

Take curl as an example

tldr++

tldr++ is an interactive tldr client written with go, I just steal the gif from its official site.

cheat

Similarly, 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. It is written in Golang, so just download the binary and add it into your PATH .

eg

eg provides useful examples with explanations on the command line.

So I consult tldr , cheat or eg before I ask man and Google.

[Apr 19, 2021] How To Display Linux Commands Cheatsheets Using Eg

Apr 19, 2021 | ostechnix.com

Eg is a free, open source program written in Python language and the code is freely available in GitHub. For those wondering, eg comes from the Latin word "Exempli Gratia" that literally means "for the sake of example" in English. Exempli Gratia is known by its abbreviation e.g. , in English speaking countries.

Install Eg in Linux

Eg can be installed using Pip package manager. If Pip is not available in your system, install it as described in the below link.

After installing Pip, run the following command to install eg on your Linux system:

$ pip install eg
Display Linux commands cheatsheets using Eg

Let us start by displaying the help section of eg program. To do so, run eg without any options:

$ eg

Sample output:

usage: eg [-h] [-v] [-f CONFIG_FILE] [-e] [--examples-dir EXAMPLES_DIR]
          [-c CUSTOM_DIR] [-p PAGER_CMD] [-l] [--color] [-s] [--no-color]
          [program]

eg provides examples of common command usage.

positional arguments:
  program               The program for which to display examples.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         Display version information about eg
  -f CONFIG_FILE, --config-file CONFIG_FILE
                        Path to the .egrc file, if it is not in the default
                        location.
  -e, --edit            Edit the custom examples for the given command. If
                        editor-cmd is not set in your .egrc and $VISUAL and
                        $EDITOR are not set, prints a message and does
                        nothing.
  --examples-dir EXAMPLES_DIR
                        The location to the examples/ dir that ships with eg
  -c CUSTOM_DIR, --custom-dir CUSTOM_DIR
                        Path to a directory containing user-defined examples.
  -p PAGER_CMD, --pager-cmd PAGER_CMD
                        String literal that will be invoked to page output.
  -l, --list            Show all the programs with eg entries.
  --color               Colorize output.
  -s, --squeeze         Show fewer blank lines in output.
  --no-color            Do not colorize output.

You can also bring the help section using this command too:

$ eg --help

Now let us see how to view example commands usage.

To display cheatsheet of a Linux command, for example grep , run:

$ eg grep

Sample output:

grep
 print all lines containing foo in input.txt
 grep "foo" input.txt
 print all lines matching the regex "^start" in input.txt
 grep -e "^start" input.txt
 print all lines containing bar by recursively searching a directory
 grep -r "bar" directory
 print all lines containing bar ignoring case
 grep -i "bAr" input.txt
 print 3 lines of context before and after each line matching "foo"
 grep -C 3 "foo" input.txt
 Basic Usage
 Search each line in input_file for a match against pattern and print
 matching lines:
 grep "<pattern>" <input_file>
[...]

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites



Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: May 05, 2021