|
|
|
use less
While I really like Safari's improved Find interface, there is one signifcant disadvantage in using it for searching text files: it doesn't handle multi-megabyte text files very well. And to some extent, vi(m) is also somewhat slow with large files.
Textmate and other GUI text editors are great overall, but why not use a tool that is pre-installed on every OS X system. So for searching large files, and still having the benefit of your search-pattern highlighted, you should ideally use the "less" utility via Terminal. less is a pager, it loads one page at a time for display, so it is instantaneous in working with enourmously huge files (virtually no size limit). It's quite simple to use; in Terminal type (without the brackets): less [filepath/yourfilename] ... then to search within your file, type: /yoursearchpattern ... to go forward, backward, within your file (while still in search-highlight mode) type: n, or N ... AND, you have the added benefit of being able to make use of some simple regular expressions to make your searches more powerful (in Safari or TextEdit, you can't). less also holds your search-patterns in memory, if you have not exited your file; so to see or edit your previous searches, just use up-arrow, or down-arrow, after typing / (ie. "slash", to do a search). -- So remember, less is more. |
SearchFrom our Sponsor...What's New:HintsNo new hintsComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,482 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.03 seconds |
|