Use the command line to access files faster

Oct 08, '01 02:26:01PM

Contributed by: hmelton

The 'open' command from Terminal command line is like a double-click on an object, and sometimes it is much faster than using the Finder, at least for me. I've been a CLI user for decades and while I appreciate the GUI, many times it is too slow. Often the Finder requires far too many operations to get to the file or folder that I need to work on. Why 'Find' a location in the directory tree when I already know where it is?

Read the rest of this article for an interesting write-up on using the command line to improve the efficiency of the OS X GUI.

Since I typically already have a Terminal shell session already open, I have begun using 'open' as a shortcut. 'open ~' opens my Home folder. 'open /Applications/OmniWeb.app' launches the browser. Yes, of course, I could (and do) use the Dock for this kind of quick access, but consider my workfiles...

I am a writer with many dozens of stories, each in their own folder contained in a parent folder five levels deep. I can't overload the dock with a folder for each -- that way lies madness. I have put the parent folder in the Dock, but even then, click and scrolling takes time, especially since the folder's are numbered instead of named.

[Side note to other writers: Instead of trying to track and file all your work by titles which can often change on the fly, assign each an 'opus' number and file them that way.]
I put the following in my .cshrc:
set opus=/Users/hmelton/Henry/works/opus
Now all I have to do, if I know the number, is:
open $opus/0073
Since I have in each story folder a simple one-line text file named 'title' containing the title, I also created this little 'opname' shell-script:
#!/bin/sh

opus=/Users/hmelton/Henry/works/opus
grep -i $1 $opus/*/title|sed -e 's//title:.*//'
To open a folder containing the word Catacomb in the title, all I have to do is:
open `opname catacomb`
(note the backquotes) and up it comes.

The mix of CLI and GUI is my favorite environment, and I have been waiting for OSX since A/UX bit the dust.

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20011008142601533