|
|
Do a man on ed
Man is basically a front end to ed (the unix line text editor). So are vi, sed and others. You'll find lots of cool things you can do with man, vi, etc. by learning ed. It's lso handy for editing commands in the command line buffer.
man uses more by default
man uses more for pagination by default. you can change
Re: man uses more by default
Yep, less is powerful superset of more. One of its big advantages is the ability to backwards scroll/search output from a command piped to it, which is convenient for browsing multi-page output like:
ls -ARl /Applications | less I use this tcsh alias to generalize on that idea: alias p "!* |& $PAGER" (insert backslash before '!' to quote it) ... after doing a "setenv PAGER less" as yobananaboy suggested. The "ls" example would then be shortened to: p ls -ARl /Applications Something more complicated: p (ls -ARl /Applications | fgrep -i .html) This is a handy alternative to scrolling the Terminal window to view output.
Re: man uses more by default
Yup, let's hear it for less. One of the nasties about more in the context of man is that it just "falls off the end" when you hit the end of the man page. With less you stop at the bottom (obviously) but you stay in less so that you can then use the "b" key to start paging back.
Re: man uses more by default
Also looking for a permanent system-wide fix, I replaced /usr/bin/more with a copy of /usr/bin/less. SO far, I have not had any problems (it has been three years)
Re: man uses more by default
Yeah, who cares if you're the only one using your machine? Many years as a sysadmin of multi-user Unix systems has me trained to leave the "system" environment as generic as possible to help reduce novice user confusion, make upgrades easier, and other minimimal-support-staff type reasons which have varying degrees of success/failure. Pity the overly-clever wannabee who gets the "brilliant" idea of renaming /usr ... at least that's more interesting than "rm -rf /". :-) Okay, enough OT.
Re: man uses more by default
Replacing 'more' with 'less' is a very ugly way to use 'less' as the default pager. This is a "Mac" (single user) way of dealing with such problems. Unix gives you much more flexibility for such things:
Re: man uses more by default
4. If you do it the "hard way", it's better to: - rename 'more' to 'more.original'
Re: man uses more by default
What I do is create .DIST and .OFF directories for saving original copies of distribution files (in .DIST) and for those I've deactivated (in .OFF). Less sloppy than using filename extensions, IMHO.Agreed. Using extensions is not a crime (Unix doesn't care for extensions) but too many '.orig', '.old', '.sav', etc. files can "litter" the filesystem. Your way is cleaner, if you have to go the "hard way".. (but avoiding the "hard way" is better). Another possible solution for saving original copies is a version control system (RCS/CVS). I started using CVS for system configuration files and shell/SQL scripts. With version control, it is possible to switch back to any previous state of a file without having to deal with the naming or placing of the old files. Furthermore, you can comment changes and group file versions belonging together, etc..
Re: man uses more by default
As you probably know, less has different ways of handling end-of-file behavior. I like "--quit-at-eof" ("-e"), set with the LESS envariable along with other options:
setenv LESS Mceis Minimalist. :-)
man uses more by default
The less pager has a lot of options; they can be controlled with the environment variable LESS.
Do a man on ed
Wow, you've got some things messed up. man is looking up
Do a man on ed
The relation is that ed, as a low level line oriented editor, provides functionality that can be embedded in higher level tools. The most obvious tool that I know for a fact is a high-level wrapper around ed is plain old vi, but the functionality of tools like more is similar enough to ed that it's at least plausible that the "editor" is embedded in the pager. Even if it's not literally embedded, clearly the interface has been copied and much of the the behavior is identical, so thinking of them as being of the same heritage is useful -- it helps you transport keystrokes from tools you already know to tools that you're still learning about.
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|