How to create your own command library

There is no doubt that the terminal de Linux (also known as Bash) is a powerful tool in every distribution. But for the newly initiated su use it may turn out something uncomfortable, trying to avoid it at all costs.

It is well known that with the command -Help we get a referential help from the terminal. Although it is a great resource, today we present one that can be much more useful and that will allow us to have on hand our own command "library" en pdf format.


The man command provides us with a terminal manual of the desired command; for example: man chmod will show us the function and syntax of the chmod command with a light text editor. Now, the following variant of the same command is the one that gives us the most advantage. We open the terminal and type:

man -t command | ps2pdf -> name.pdf

We replace the command line with the command from which we want to obtain the manual and name.pdf by the name of the pdf we want to create and where we are going to create it; By default, if we do not assign a different path, the file will be created in the personal folder. Returning to the previous example about the chmod command, we can write:

man -t chmod | ps2pdf -> /home/usuario/Documentos/ManualChmod.pdf

Taking the manual from the chmod command creates a pdf called ManualChmod in the Documents subdirectory of the personal folder. The pdf created includes the function of the command and all the possible combinations of its syntax, helping us to fully exploit the use of the terminal.

A great advantage of this method is that if we have the Spanish language pack well configured in our distribution, the pdf will be exported in our mother tongue, also helping to understand faster than the manual, which by default shows the manual in English. Hopefully it helps both beginners and experienced riders!

Thanks Juan Carlos Ortiz for the contribution!
Interested in make a contribution?

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Let's use Linux said

    I'm glad, man! A big hug! Paul.
    On 07/06/2012 20:52, «Disqus» wrote:

  2.   The Urogayo said

    Excellent! Read the page "How to put the man pages in Spanish".
    All commands in Spanish!
    Thank you.

  3.   Let's use Linux said

    Did you try changing the man to Spanish? http://usemoslinux.blogspot.com/2011/03/como-poner-las-paginas-de-man-en.html Cheers! Paul.

  4.   Mario Alberto Perez Mancia said

    very good contribution gratitude in multutid.

  5.   The Urogayo said

    The same as Xesu.
    I have tested the example and the PDF file is in English. How can it be configured to show the files in Spanish?

  6.   Juank said

    Note that each distribution has a small program to configure the language pack you use. I use Linux Mint, so I look at Menu> Preferences> Language Support, and if the Spanish package is incomplete, that same program will notify me and give me the possibility to download it. If you have the complete language package, the pdf will automatically be exported in Spanish, no additional configuration is necessary 😉

  7.   xexu said

    And if we do not have the Spanish language package properly configured, how can we configure it correctly and import it in Spanish?

    Thanks in advance

  8.   Hache said

    Buah! This is great! Thank you so much 😀

  9.   eM Say eM said

    Very interesting, I am one of those who always looks for the man, but I am a bit lazy to read it in full, now if I convert it to PDF much better.