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>
?
Asked
Active
Viewed 206 times
1

enchance
- 29,075
- 35
- 87
- 127
-
Yes, but troff can be tedious to write. – Ignacio Vazquez-Abrams Aug 05 '15 at 03:46
-
See this question and answers about creating man page entries: http://stackoverflow.com/questions/14030904/how-to-add-entry-in-linux-man-page-database – Carlos Macasaet Aug 05 '15 at 03:48
-
If you type `alias
`, Bash will remind you what it is. Does that suit? – piojo Aug 05 '15 at 03:52
1 Answers
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