LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2013, 11:23 AM   #1
Jeff9
Member
 
Registered: Jun 2013
Posts: 36

Rep: Reputation: Disabled
Keep man page display


I'm trying to learn about (for example) the ps command. I type man 1 ps and start reading. I want to try some options I read about, so I press q, the man page disappears. WTF?

I would like to reduce the number of terminal windows I have open (I already have 3 or 4 open - one for file editing, one for compiling/executing, one or two for attempted debugging using gdb - just to do my work). Is there no way to keeping a man page up? That would be so much more convenient.

I tried man man and read about man -W. But the files listed are not text files, so I couldn't just cat them.
 
Old 07-27-2013, 11:42 AM   #2
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,351

Rep: Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316Reputation: 1316
Basically, you can't do two things at the same time in one terminal!

A nice way of reading man pages is in your browser
http://www.linuxmanpages.com/
http://linux.die.net/
and your desktop's help system may incorporate man pages (Mate and Gnome do) or your distro may have a dedicated reader (Salix does).
 
Old 07-27-2013, 11:50 AM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I hear ya... I haven't yet sorted that out, but I know it doesn't happen on all systems I use. I haven't taken the time to explore it, but my hunch is that it is a result of a setting somewhere for the 'pager' system. As I understand it, man uses another facility, could be more/less or some other utility, to page through it's output. I believe there is a global or user-specific setting that governs this behavior. Sorry I can't be more specific, but if you do pursue it, I'd love to know what you come up with.

--- rod.
 
Old 07-27-2013, 11:53 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
A manual page can be kept open (i.e. in terminal after reading it) and will not get disappear after finishing it. Just check help section of man:
Code:
~$ man --help
And in following way, you can keep the page in terminal after finish reading it. You also need not to press q at the end of the page. And after reading it, you can run next command.
Code:
~$ man -P <pager-type> <command-name>
For example:
Code:
~$ man -P more ps
In addition, use spacebar key to read the manual page-by-page manner or use enter key to read the manual line-by-line.

Last edited by shivaa; 07-27-2013 at 11:56 AM. Reason: Typo
 
Old 07-27-2013, 12:12 PM   #5
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
If you are using "less" for viewing man pages, you can press "!" and enter commands to execute. After execution press Enter key to back to manual.

What wrong is with multiple terminal windows? In my opinion this is most convenient.

Last edited by eSelix; 07-27-2013 at 12:18 PM.
 
Old 07-27-2013, 12:27 PM   #6
fogpipe
Member
 
Registered: Mar 2011
Distribution: Slackware 64 -current,
Posts: 550

Rep: Reputation: 194Reputation: 194
Or you can use "ctrl-z" to background the man page you are reading and then "fg" to make it visible again after you are done entering your commands.
 
Old 07-27-2013, 01:18 PM   #7
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
screen is your friend, yes you can do more then 1 thing in a single terminal.

https://www.rackaid.com/resources/li...al-and-how-to/

http://www.thegeekstuff.com/2010/07/...mand-examples/

http://unix.stackexchange.com/questi...-than-one-view

i use the S option a fair amount as it allows you to do exactly what you want. have the man page open at the same time you are playing with commands in an other portion of the same terminal.

Enjoy.
 
Old 07-27-2013, 02:41 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,613

Rep: Reputation: 4064Reputation: 4064Reputation: 4064Reputation: 4064Reputation: 4064Reputation: 4064Reputation: 4064Reputation: 4064Reputation: 4064Reputation: 4064Reputation: 4064
Quote:
Originally Posted by Jeff9 View Post
I'm trying to learn about (for example) the ps command. I type man 1 ps and start reading. I want to try some options I read about, so I press q, the man page disappears. WTF?

I would like to reduce the number of terminal windows I have open (I already have 3 or 4 open - one for file editing, one for compiling/executing, one or two for attempted debugging using gdb - just to do my work). Is there no way to keeping a man page up? That would be so much more convenient.

I tried man man and read about man -W. But the files listed are not text files, so I couldn't just cat them.
So go to the Internet, and pull up the man pages in your web browser. Use a terminal program like konsole or yakuake, that supports tabs, and have one window up with multiple terminal windows in it.
 
Old 07-27-2013, 03:55 PM   #9
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
All of those solutions require some extra component, which is a fair suggestion for most cases. Sometimes, you only have one console, such as if you don't have an X server, or if your connection is a serial console.
The -X option to less seems to have the desired effect. Now, just how to get the -X option to be used by man when it invokes less...

--- rod.
 
Old 07-27-2013, 04:04 PM   #10
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Found it!!
Code:
export LESS='-X'
less gets used as the pager, and it reads its options from the $LESS environment variable. If your $LESS is already specified, you'll have to add the -X option to whatever is already there. You can set the variable in your user .bashrc, or in the global one in /etc.

--- rod.
 
Old 07-27-2013, 05:00 PM   #11
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 7,995
Blog Entries: 11

Rep: Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170
Code:
export LESS='FiX'
I've used this for at least 2 years.
 
Old 07-27-2013, 07:29 PM   #12
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
Quote:
Originally Posted by theNbomr View Post
All of those solutions require some extra component, which is a fair suggestion for most cases. Sometimes, you only have one console, such as if you don't have an X server, or if your connection is a serial console.
The -X option to less seems to have the desired effect. Now, just how to get the -X option to be used by man when it invokes less...

--- rod.
and how does screen, something that is rather basic, require extra components. is that not what its use is? to accomplish more then one task inside of one terminal when you dont have the luxury of a GUI or the ability to switch to an other terminal connection as you might be using something like ssh.
 
Old 07-28-2013, 11:52 AM   #13
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
screen IS the extra component. Yes, I realize it comes pre-installed on many distros, but it requires deliberate use for it to be a solution, and for those cases where console resources are scarce, it is often the case that memory, storage and CPU is also scarce, so it's memory footprint can matter. Moreover, it doesn't solve the problem of having the relevant passage of the man page visible while typing at the commandline, which is the case I find most troubling when the man page disappears after I've found what I'm looking for.

Don't get me wrong, I use screen all the time and for some pretty outside the box purposes so I'm not saying it isn't a useful tool.
--- rod.

Last edited by theNbomr; 07-28-2013 at 11:57 AM.
 
Old 07-29-2013, 06:01 PM   #14
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
http://notary.brunkow.ws/images/terminal_screens.png

have screen running, using man page and issuing commands at the $ prompt.

as for its CPU usage, a single terminal even running screen is next to minimal. if you are running out of system resources running a terminal and screen, you have bigger problems then looking at the man page while issuing commands.

heck split that into 4 if you wish and get even more accomplished at once. although the most ive ever needed at any one time other then playing around or performing the same task on multiple servers via ssh is 3. typically monitoring some log file in one -S, top or some other tool in a second -S, and then issuing the command in the third -S.

Last edited by lleb; 07-29-2013 at 06:04 PM.
 
Old 07-29-2013, 06:16 PM   #15
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,176
Blog Entries: 1

Rep: Reputation: 2223Reputation: 2223Reputation: 2223Reputation: 2223Reputation: 2223Reputation: 2223Reputation: 2223Reputation: 2223Reputation: 2223Reputation: 2223Reputation: 2223
Just split the window with screen.

I use tmux, but same idea for screen.

Ctrl-A-" - splits window
man whatever

Ctrl-A-O - switch back and forth between split windows

Ctrl-A-X - close current side of split

How much easier do you want it to be?

[EDIT]
lleb beat me to it - have a look at his/her screenshot.
[/EDIT]

Last edited by astrogeek; 07-29-2013 at 06:20 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
man page is not found although $MANPATH and man.conf changed Abbraxas Linux - Newbie 3 09-05-2011 06:40 PM
Apostrophes in man page do not display correctly massysett Slackware 7 09-27-2009 10:39 PM
man page display problem staul Linux - Software 0 02-22-2005 02:01 AM
man page display in aterm rekurzion Linux - Software 11 12-03-2004 05:01 AM
man page often display: see also .....(X).. nutshell Linux - General 3 03-02-2002 05:43 AM


All times are GMT -5. The time now is 04:23 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration