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:
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:
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 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:
My default editor is Vi. Now, we can start to add everything you need to remember about the 'apt' command in this template.
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:
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
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.