LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 02-13-2020, 08:14 AM   #1
crajor
Member
 
Registered: Mar 2019
Location: Akron, Ohio
Distribution: PCLinuxOS 2020
Posts: 88
Blog Entries: 4

Rep: Reputation: Disabled
Wink 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.
 
Old 02-13-2020, 11:56 AM   #2
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
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
 
1 members found this post helpful.
Old 02-13-2020, 01:40 PM   #3
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
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.
 
1 members found this post helpful.
Old 02-13-2020, 02:14 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,237

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
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.

Last edited by dugan; 02-13-2020 at 03:41 PM.
 
1 members found this post helpful.
Old 02-14-2020, 09:34 AM   #5
crajor
Member
 
Registered: Mar 2019
Location: Akron, Ohio
Distribution: PCLinuxOS 2020
Posts: 88

Original Poster
Blog Entries: 4

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 02-14-2020, 09:51 AM   #6
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 560

Rep: Reputation: 220Reputation: 220Reputation: 220
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.
Attached Thumbnails
Click image for larger version

Name:	no-colors.png
Views:	27
Size:	14.8 KB
ID:	32539   Click image for larger version

Name:	colors.png
Views:	25
Size:	15.0 KB
ID:	32540  
 
Old 02-14-2020, 09:59 AM   #7
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,237

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
I like to do:

Code:
export MANPAGER=most
 
Old 02-14-2020, 10:03 AM   #8
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 560

Rep: Reputation: 220Reputation: 220Reputation: 220
Why is most better than less?
 
Old 02-14-2020, 10:33 AM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,237

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
It's in color out of the box, without needing any further configuration.
 
Old 02-14-2020, 10:47 AM   #10
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 560

Rep: Reputation: 220Reputation: 220Reputation: 220
Well, indeed it is. Maybe I should switch and slim down my ~/.bashrc?
 
Old 02-15-2020, 06:14 AM   #11
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
@OP:
yeah, I'd just open another terminal.
But graphical man page readers exist - Xman for example.
 
Old 08-19-2021, 01:09 AM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Information] All Debian sources are now easily accessible. Didier Spaier Slackware 6 12-11-2017 07:06 AM
LXer: Making Linux More Accessible LXer Syndicated Linux News 0 11-10-2013 10:53 AM
LXer: Making voice more accessible with OSS LXer Syndicated Linux News 0 03-28-2006 07:21 PM
NTFS (winxp) drive is accessible only by root, why NTFS (winxp) drive not accessible Samppa72 Linux - Software 1 07-26-2004 03:13 PM
Need help making FTP daemon accessible through firewall Electrode Linux - Networking 1 08-12-2003 05:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration