Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Drag and drop paths in the terminal System
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!
    •    
  • Currently 2.14 / 5
  You rated: 1 / 5 (7 votes cast)
 
[6,069 views]  

Drag and drop paths in the terminal | 1 comments | Create New Account
Click here to return to the 'Drag and drop paths in the terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Drag and drop paths and URLs into the terminal
Authored by: abriening on Dec 22, '03 07:50:40PM

Tonight I accidently dropped an image from Safari onto an open Terminal window, and it showed the URL to the image. You can also drag and drop web-links into the Terminal from Safari and Internet Explorer. Drag and drop works with text from Word. I suppose it works with anything that is draggable.

Another quick technique to use with the Terminal is to select a directory or a file then hit Cmd-Shft-Y to open a Stickie note with the path to that file. Copy-and-paste into the terminal; no need for typing paths.



[ Reply to This | # ]