How to Open and Save UNIX / Linux man Pages to vi Editor File?



Suppose if you wanted to print the Unix man pages, it has to be copied to a single file. Normally man pages displays page by page. You can easily open the man pages in vi editor using combination following commands.


This command will open the cat command man page in vi editor.

man cat |ul -i|tr '\!' ' ' |vi -

Below command will write the cat command man page to cat.txt file.

man cat |ul -i|tr '\!' ' ' >cat.txt

where

ul command convert underscore, ^[[1m, ^[(B to readable format. See some examples on ul command below.

$ echo $'h\b_i\b_n\b_t\b_s\b_'
_____

$ echo $'h\b_i\b_n\b_t\b_s\b_' | ul
hints

$ echo $'h\b_i\b_n\b_t\b_s\b_' | ul -i
hints
_____

tr command is used for translation.

How is it?

No comments:

Post a Comment