LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   making information more accessible (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/making-information-more-accessible-4175669523/)

crajor 02-13-2020 08:14 AM

making information more accessible
 
I am writing this thread in the hope that newer users of linux can make use of this 'trick' to make needed information more accessible and also more usable.
I have found that using man pages in the terminal to be cumbersome. That has kept me (until now) from accessing this information that is honestly the best info for linux commands used in the terminal. Then I had a thought "can I make a document of a man page that I could then look at and use in a text editor?"
The answer is YES, and it is not hard to do.
When the man command is entered it is followed by the linux command that we want to research, such as;
Code:

man ls
we then see the man page for that command, ls in this case. For me however I find working in the terminal with man docs in terminal to be not as easy as I would like - for one thing, it would be nice to have that doc available in another place than the terminal so that I could refer 'back and forth' between the man doc and actually working with the command in the terminal. Also, scrolling in a text editor is much easier than in a terminal.(there may be other opinions about that, I am just speaking personally here.)
So to make a man doc available to a text editor, we just have to pipe the output to a filename where the output is then sent and saved. Using our ls example,
Code:

man ls > manls
.
Based on being in our home directory, manls is now a text file in our home directory that can be opened with our text editor of choice and made available when we are working with that particular command.
I have made these text files that for me are commonly used commands in the terminal
Code:

ls
Code:

cp
Code:

mv
.
It is also possible to do the same sort of thing with info files.
these pages are like man pages, but with additional explanation.
Just use this command still using ls as an example;
Code:

info ls > infols
Now we have an info page for the ls command that is named infols that is available to our text editor of choice, and again can be accessed at the same time that the command is being used in a terminal.
I love the results of this work and hope others can use this trick to improve 'info access' efforts.

sevendogsbsd 02-13-2020 11:56 AM

Interesting perspective. If I need to work with a manual, I just open another terminal. Personally, I find no utility in saving the same info to another format but I get that some people are not entirely comfortable working at the command line. I just don't see the difference between a text file and a man page.

Having said that, there is more than one way to skin a cat, as they say, so the ability to do things like this is what gives us open source operating system users our power :)

273 02-13-2020 01:40 PM

I think I would likely just use screen if I were looking to configure a machine and read man pages.
However, as above, what works for you works for you and may help others.:)

dugan 02-13-2020 02:14 PM

You should look into TLDR (which has a number of command-line clients) and cheat.sh. Both of which are designed to get you the information you need more efficiently than manpages.

As for the problem you're trying to solve, though: surely that could be better solved by using a terminal (possibly in combination with a multiplexer) that supports splits and tabs, or by opening two terminals?

I mean, if the pager is properly set up, you have colored sections in the manpages. If you just open the same pages in a text editor, you lose that.

If you use Konqueror, you can also open the ls manpage by entering "man:ls" in the address bar. IIRC.

crajor 02-14-2020 09:34 AM

Thank you all very much for the input. True, more than one way to 'skin a cat' and I am not putting this out there as the only option. I now have some other methods, and that is great.

average_user 02-14-2020 09:51 AM

2 Attachment(s)
Reading manpages in the terminal does not have to be cumbersome. For starters, You can use / to start searching for something in most pagers and searching is case-insensitive by default. You can also enable colors to make manpages more readable if you use less:

Code:

man ()
{
    env LESS_TERMCAP_mb='' LESS_TERMCAP_md='' LESS_TERMCAP_me='' LESS_TERMCAP_se='' LESS_TERMCAP_ue='' LESS_TERMCAP_us='' man "$@"
}

Compare man ls without colors in the attached screenshots - manpages are much nicer with colors.

And some editors such as Emacs come with their own man viewer - you don't have leave the comfort of your editor and use editor's keybindings to read the manpage.

dugan 02-14-2020 09:59 AM

I like to do:

Code:

export MANPAGER=most

average_user 02-14-2020 10:03 AM

Why is most better than less?

dugan 02-14-2020 10:33 AM

It's in color out of the box, without needing any further configuration.

average_user 02-14-2020 10:47 AM

Well, indeed it is. Maybe I should switch and slim down my ~/.bashrc?

ondoho 02-15-2020 06:14 AM

@OP:
yeah, I'd just open another terminal.
But graphical man page readers exist - Xman for example.

chrism01 08-19-2021 01:09 AM

For a more readable / searchable version, i like https://linux.die.net/man/.

However, it may not be definitive for the exact version you are using, but I normally find it's good enough.

HTH


All times are GMT -5. The time now is 09:31 AM.