 |
 |
Really Dumb Question re Terminal
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status:
Offline
|
|
When I'm done viewing a man page (i.e., the manual for a particular command), I get the usual notation (END). The odd thing is, I don't know how to go from that point back to the prompt except by using ^C or something like that. Spacebar, Return don't seem to do it.
What am I missing in my brainlessness???
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
Here's an idea... start at the top left of your keyboard with the letter q. We are starting there arbitrarily because it's the first letter of qwerty--not because q stands for quit or anything.
Then, just go across the keyboard like so:
qwertyuiop
asdfghjkl
zxcvbnm
I have a sneaking suspicion that a linear search is going to provide excellent results in this case.
BTW, I typed this up because the board said that my answer was too short, so I had to put something in other than just the letter q.
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status:
Offline
|
|
LOL. Like I said, it was a stupid question.
"q" clears the screen and gives me a new prompt. Suppose I want to keep the man info so I can scroll back and read it as I work. What then?
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
It doesn't give you a new prompt; it returns you to the one you were in when you opened the man page.
If you want the whole man page to stay in the buffer, then you want to view the man page in something other than a pager. The closest I could get from reading the man and less manpages is to call man with the -t option, but that results in very ugly output.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status:
Offline
|
|
The way I usually do this is to:
man <page_name> | grep ""
That just dumps everything to the output, and then I use Terminal.app's scrolling buffer and find commands (which are usually better than man's).
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2003
Location: Oslo, Norway
Status:
Offline
|
|
Originally Posted by larkost
The way I usually do this is to:
man <page_name> | grep ""
That just dumps everything to the output, and then I use Terminal.app's scrolling buffer and find commands (which are usually better than man's).
Great tip!
I have to remember that one.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
I generally open a second terminal window to have the man page open and visible. This way, you can still scroll through it without losing your command prompt.
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status:
Offline
|
|
Nice tips, folks. Thanks! Try this too: Man Pages.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2001
Location: State of Denial
Status:
Offline
|
|
Could do
man foo | cat
also.
|
|
[Wevah setPostCount:[Wevah postCount] + 1];
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Apr 2002
Location: case.edu
Status:
Offline
|
|
try (if using bash):
export TERM=vt100
man foo
|
pb 1440x960 | 1.67, 1.5, 128, 80 | leopard
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status:
Offline
|
|
Originally Posted by Tesseract
try (if using bash):
export TERM=vt100
man foo
By the way: "There's no ... such thing ... as a tesseract."
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Apr 2000
Location: Germany
Status:
Offline
|
|
Originally Posted by selowitch
Suppose I want to keep the man info so I can scroll back and read it as I work. What then?
"man appname > Desktop/appname.txt" gives you a textfile with the man page in it on your desktop
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status:
Offline
|
|
Originally Posted by Stefan
"man appname > Desktop/appname.txt" gives you a textfile with the man page in it on your desktop
That's really cool! Thanks.
|
|
|
| |
|
|
|
 |
|
 |
|
Admin Emeritus 
Join Date: Oct 2000
Location: Boston, MA
Status:
Offline
|
|
If you'd like to avoid piping man to cat every time, you can also add this line to your .bash_profile (if you're using bash),
export MANPAGER=cat
or in .tcshrc (if you're using tcsh)
setenv MANPAGER cat
Normally the pager is set to less. This opens up the possibility for viewing man pages through vim:
export MANPAGER="col -b | view -c 'set ft=man nomod nolist' -"
|
|
"Against stupidity, the gods themselves contend in vain" (Schiller)
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Apr 2002
Location: case.edu
Status:
Offline
|
|
Read your manpages in Preview.app:
man -t ls | pstopdf -i -o manpage.pdf && open manpage.pdf
|
pb 1440x960 | 1.67, 1.5, 128, 80 | leopard
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status:
Offline
|
|
I've started using a browser to read man pages if I need anything other than a quick look.
google "man ps os x" will give several sites with the man pages as html. Like this: http://www.hmug.org/man/1/ps.php
Much nicer than scrolling in the terminal.
That preview trick is COOL.
And don't feel too dumb. When I first started out with linux I actually had to pull the power cord on the back of the box to get out of vi.
(Last edited by Gavin; Jul 1, 2005 at 03:10 AM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
The Preview trick is cool, but PDF just somehow isn't the way I'd like to read things.
Regardless, if you really want to use it I recommend putting this in your ~/.profile
Code:
manpdf() {
[[ "$#" != "1" ]] && echo "USAGE: manpdf name" && return 1
OUTPUT="/tmp/man $1.pdf"
[[ ! -r "$OUTPUT" ]] && man -t "$1" | pstopdf -i -o "$OUTPUT"
open "$OUTPUT"
}
This will output the PDF file to /tmp as, for instance, "man ls.pdf" and open it in your default PDF reader. Since each program's manpage is saved separately, you don't have to recreate the file each time you want to view a manpage. Change the path of $OUTPUT to somewhere else if you'd like to keep the PDFs around after rebooting.
Edit: Incidentally, the font caching that happened after running pstopdf for the first time caused problems with Gimp.app. If you use this trick and then find that Gimp.app won't start anymore, delete ~/.font-cache-1 (or something like that; I'm not at my machine to check).
(Last edited by wataru; Jul 15, 2005 at 12:37 AM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 2004
Status:
Offline
|
|
I like to open up X11, and run the following command (I have it stored in my apps menu)
Code:
killall quartz-wm;/usr/X11R6/bin/xterm -geom 80x52+15+37&/usr/X11R6/bin/xterm -geom 80x52+527+37&
kills the quartz window manager for X11, which I like because it allows that cool trick where the terminal is focused on my mouse location rather than by mouse click, but sucks cause then I can't move the windows around. Therefore, when I launch two instances of xterm, I give them a home to live in (that is, I give them a default size).
Now, I move my mouse over the right-hand one, and type "man amaya" (or whatever), and then I page to where I want, move my mouse over the left one, and run the command as I wish... need more paging, simply move the mouse back over the right hand window and start doing your stuff...
That said, there's probably a better way to do this in a later version of X11, but in 10.2, that's the only way it works for me...
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
From Apple's X11 FAQ:
Q: Is there an option for no-click-to-focus for X11 applications?
A: Yes there is a hidden option. From an xterm or terminal execute : defaults write com.apple.x11 wm_ffm true
Doesn't say if it works in 10.2 or not.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 2004
Status:
Offline
|
|
that works quite nicely...
thanks for the link! I found someplace else that had a command for that, but I think it didn't work, or maybe I was just being stupid and only opened one window (it's interesting... when you have only one window open, it's always focused, but when you have multiple, then the focus follows the mouse...
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Location: Adelaide, South Australia
Status:
Offline
|
|
Originally Posted by wataru
If you want the whole man page to stay in the buffer, then you want to view the man page in something other than a pager. The closest I could get from reading the man and less manpages is to call man with the -t option, but that results in very ugly output.
If you're not completely attached to something like xterm-color as your TERMINAL setting then changing that to, say, vt100 will do the trick of saving the output from commands such as man or top.
setenv TERM vt100
[in tcsh], or
export TERM=vt100
in the usual startup files for bash or zsh.
Cheers,
Paul
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
Originally Posted by arcticmac
that works quite nicely...
thanks for the link! I found someplace else that had a command for that, but I think it didn't work, or maybe I was just being stupid and only opened one window (it's interesting... when you have only one window open, it's always focused, but when you have multiple, then the focus follows the mouse...
Well the focus-follows-mouse setting only affects X11 windows, so of course it's not going to work with only one window open--there's nothing else to focus on.
Glad it works, though. I was worried since Apple left the Jaguar X11 in beta forever, and now even asks you not to distribute it anymore.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|