480

I use command line a lot, like most programmers. I want to be able to launch Finder, Safari or any other application for that matter from command line e.g.

finder .

where it will start Finder app, and the set the view to the current folder that I am in at the command line.

2
  • 3
    I disagree that this is a duplicate. I found this when Finder was force quitted and I wanted to launch it again. The other question doesn't address this aspect of the problem, this one does.
    – razzed
    Commented Aug 6, 2014 at 14:14
  • 3
    I agree: not a duplicate. This question is about how to launch the program. The other is just about how to open a new window.
    – Andy Swift
    Commented Mar 31, 2015 at 8:14

1 Answer 1

714

To open your current directory in Finder from Terminal, type open .

So, if you want Documents: open Documents

Library: open /Library

Downloads: open Downloads

And so on.

10
  • 182
    Boom! open . is the winner here.
    – bmike
    Commented Sep 10, 2013 at 22:33
  • 4
    you did fine - linking the dupes helps with search terms. Your answer or this questions' words get indexed so that people searching the internet find the right answer.
    – bmike
    Commented Sep 11, 2013 at 1:40
  • 2
    This doesn't work if your current directory is an application, like /Applications/Something.app. It will open that app instead of finder.
    – Segfault
    Commented Jul 3, 2014 at 20:53
  • 28
    @Segfault To force it to open an application as a file in Finder, rather than the open the application itself, use the -R option: "-R Reveals the file(s) in the Finder instead of opening them." For example, you can do cd /Applications/Preview.app; open -R . and it will open Finder, not Preview. Commented Jun 23, 2015 at 20:19
  • 2
    open `pwd` is safer, does the same thing as open . Commented Jun 23, 2016 at 2:56

Not the answer you're looking for? Browse other questions tagged .