1

I have a lot of aliases when working with bash, and sometimes I tend to forget what a certain alias does. Is it possible to create a short description for an alias when running man <youralias>?

enchance
  • 29,075
  • 35
  • 87
  • 127

1 Answers1

2

While there is an answer to this on How to add entry in Linux man page database

It's easier to do this.

Create a text file with a short paragraph explaining your alias, and then save it to alias-name.txt

Get ronn (a ruby gem) this will generate a man/troff/roff format file from your text.

gem install ronn

Then convert your text file:

ronn -r alias-name.txt

A file ./alias-name will be created, move it to your local shared man path. eg.

mv alias-name /usr/local/share/man1/alias-name.1

Now admire your handiwork...

man alias-name

To get more advanced in your formatting look at the ronn-format (based on Markdown.) https://rtomayko.github.io/ronn/ronn-format.7.html

Community
  • 1
  • 1
ocodo
  • 29,401
  • 18
  • 105
  • 117