Drag & Drop Finder Items into the Terminal to Automatically Type their Full Path

Mar 2, 2011 - 8 Comments

drag-file-into-terminal-for-path

You can instantly print an items full path in the Terminal by dragging and dropping any Finder item into a Terminal window.

In the screenshot above, I have dragged Quartz Composer into a Terminal tab while nano was open. The full path is then typed out automatically, as shown in the screenshot below:

file-path-dragged-file-terminal

The next time you’re in the Finder and want to access a file or directory within the terminal, try this out, I find it’s quicker than using tab completion for deeply buried files.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: William Pearson in Command Line, Mac OS X, Tips & Tricks

8 Comments

» Comments RSS Feed

  1. michael says:

    nice trick

  2. DD says:

    wow, what a kewl trick! leave it to Apple…

  3. [...] If you want to use a text file that is buried deep somewhere on your Mac, remember you can drag and drop the icon into the Terminal to display it’s full path. [...]

  4. [...] approach would be to type “cd ” followed by dragging a folder into the terminal to print the full path, then hitting return to get the same result. [...]

  5. [...] is to type the first part of the command then drag and drop the file into the Terminal window. This automatically types the path for [...]

  6. [...] new to the Terminal, remember that dragging & dropping files into the Terminal window will print their full path, making it easy to point to source files and preventing any navigation through the command [...]

  7. [...] you know the path to the file just type it yourself. If you don’t, follow the drag & drop method to automatically type the entire path within the Terminal, just be sure to drop it in after the [...]

  8. [...] and dropping anything into the OS X Terminal outputs the full path to that [...]

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates