Drag and drop paths in the terminal
Mar 02, '01 09:54:21PM
Contributed by: robg
If you want to 'cd' into some folder that's buried sixteen levels deep on your hard drive in the terminal, there are two ways to do it.
The hard way is to type:
cd path/to/very/deeply/buried/folder/on/your/drive
Of course, you could also do this one line at a time. Either way, you'll end up typing quite a bit.
The easy way is to navigate to the folder in the finder with point-and-click. Type 'cd [space]' into your terminal window, and then drag and drop the folder from the finder into the terminal window. The full path will be displayed, and you can then just hit 'return' and the command will be executed.
You can also use this trick for files; if you want to compress something with 'tar,' just type 'tar [options-you-want] [space]' and then drag the file to compress into the terminal window and hit return. Very nifty, and very Mac-like!
Comments (1)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010302215421141