Um, create and maintain your own Ubuntu man pages

about um

In the next article we are going to take a look at Um. Today no one can doubt the usefulness of man pages and their alternatives. These alternatives are used mainly to have access to custom examples, and thus not have to go through the entire man pages. If you are looking for a quick way to communicate or learn a Gnu / Linux command easily, these alternatives are worth trying. Um is going to allow us to create our own help pages for a command. This is a terminal utility, which is very useful for easily create and maintain our own man pages that contain only what interests us.

By creating your own help pages, you can avoid many "details”Of a man page and include in it only what is necessary to take into account for the case that interests us. If you ever wanted create your own set of Man pages, Um will definitely be useful to you.

Install Um on Ubuntu 18.04

Um is available for Gnu / Linux and Mac OS. At the time I write this, I just can be installed using Linuxbrew package manager on Gnu / Linux systems. Check the following article if you haven't installed Linuxbrew yet on your Ubuntu, as it is necessary to do the following.

Once Linuxbrew is installed, run the following command in a terminal (Ctrl + Alt + T) to install Um:

UM installation with linuxbrew

brew install sinclairtarget/wst/um

If everything goes well, the terminal will tell us that the installation has finished satisfactorily.

Before using it to make your man pages, you must enable bash completion for Um. To do so, open your file ~ / .Bash_profile:

vi ~/.bash_profile

And, add the following lines to the file:

bash profile um install linuxbrew

if [ -f $(brew --prefix)/etc/bash_completion.d/um-completion.sh ]; then
. $(brew --prefix)/etc/bash_completion.d/um-completion.sh
fi

Save and close the file. Now run the following command to update changes:

source ~/.bash_profile

All ready. Now we can create our first man page.

Configure Um

For view current settings, run:

UM configuration

um config

In this file, we will be able to edit and change the values ​​of the options such as the default theme, page directory and pages, as we are best interested. Let's say for example that if you want to save the created Um pages in your Dropbox folder, just change the value of the pages directory directive and send them to the Dropbox folder in the archive ~ / .um / umconfig writing inside it.

pages_directory = /home/tu-usuario/Dropbox/um

This file, if not created, will need to be created to store the configuration.

Create and maintain your own man pages

Let's say if you are interested create your own man page for the command 'apt', run in the terminal (Ctrl + Alt + T):

um edit apt

The above command will open a template in your default editor:

man page template about apt created with um

My default editor is Vi. Now, we can start to add everything you need to remember about the 'apt' command in this template.

full page um apt

As seen in the screenshot above, I have added a synopsis, description and some options of the apt command, as an example. You will be able add as many sections as you want on these pages. Make sure you have given appropriate and easy-to-understand titles for each section. Once done, save and exit the file. If you are using the Vi editor, press the ESC key and type: wq.

Now you can view your newly created man page using command:

Man page created with apt um

um apt

As you can see, the man page for apt looks the same as the official man pages. If you want to edit and / or add more details in a man page, run the same command again and add the details you want.

um edit apt

Para ver the list of man pages created recently using Um, run in terminal (Ctrl + Alt + T):

um list

If not you no longer need a particular page, just delete it as shown below:

um rm dpkg

For see help section and all the general options available, launch the command:

um help

um --help

All man pages will be saved in a directory called ~ / .um in your home directory. Whoever wants can know more about this application in the repository that the project has in GitHub.


Be the first to comment

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.