Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Many applications (Eclipse, TextMate, ...) use OS X's integrated Open File… dialog where you have to browse and select the file and then click Open. I have many directories with many files. So opening the file can take even 20 seconds.

However I have the URL from the terminal. Given this URL of the file in the buffer, how can I use it to open the file quickly in a standard way? Is that even possible? One would expect that putting the URL in the search box would work, but it does not.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You probably mean a path (/Users/danielbeck/Desktop/file.txt) and not a URL (file:///Users/danielbeck/Desktop/file.txt) if you get it from Terminal.

If so, you can press CmdShiftG in the file dialog of the program you want to open the file with, paste the path, and the file will get selected. Just confirm the selection and the file will be opened.


Alternatively, you can use the open command in Terminal to open it in the default program:

open /Users/danielbeck/Desktop/file.txt

Or in a specific program, e.g. Sublime Text 2:

open -a 'Sublime Text 2' /Users/danielbeck/Desktop/file.txt

This approach also supports file:// URLs.

(This will probably not work with Eclipse)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.