Open Current Folder in Finder from Terminal of Mac OS X

Nov 30, 2009 - 14 Comments

Terminal in OS X Want to open a Finder window from the current directory location in Terminal? Mac OS makes this easy!

From the Mac Terminal, you can immediately open whatever folder or directory you are working within into the Finder of MacOS and Mac OS X by simply typing the a short command string and executing it. To try this out yourself, you’ll want to use the following command:

How to Open the Current Directory in a Finder Window from Terminal on a Mac

Assuming you’re already in the Terminal application, found in /Applications/Utilities/ the command to type is as follows:

open .

Hitting return and executing “open .” (yes that is a period, and yes it is required) will open the present working directory (PWD in the world of UNIX acronyms) in the Terminal / Command line into the Finder of the Mac – you know, the visual file system.

You can do this from anywhere in the command line as long as you’re in a local path, but it doesn’t matter if it’s system files or user files, you can launch it into the Finder. This can actually be a really helpful way to modify and adjust buried system files if you found them through the command line but now need to interact with them in the Finder.

For example if you’re digging around in /Library/Preferences/Mozilla/ and type open . that folder will be opened in the Finder. Or if your CWD is /etc/ and you want to access that directory immediately in Finder, type ‘open .’ to access it.

open folder from terminal

The screenshot above shows this in action while the PWD within the Terminal is the /Applications directory, thus the Applications folder is opened in the Finder.

This is useful for many reasons that I’m sure you can think of, and it’s one of those must-know tricks for command line users in Mac OS X.

By the way, you can also set this up to go the other way, from Finder to Terminal, if you’d like.

This isn’t the only option to open the present working directory from Terminal into a new Finder window on the Mac, you can also use the ‘open’ command like so:

open `pwd`

Note that those are not quotation marks but the tilde press instead. As mentioned before, pwd stands for present working directory, and this launches into that in a new Finder window the same way ‘open .’ does.

Use whichever approach works for your needs. And if you have any similar tips or tricks for opening Finder windows from the command line of Mac OS, share them in the comments below!

.

Related articles:

Posted by: David Mendez in Command Line, Mac OS, Tips & Tricks

14 Comments

» Comments RSS Feed

  1. aliday says:

    open .

    that’s all =)

  2. Rodolfo says:

    MacOS Mojave

    No application knows how to open ..

  3. Zeke says:

    Nice tip, but is there a command to close the folder?

    • Paul says:

      As far as I know you can not close a specific Finder window from Terminal, but you could use the Keystroke Command+W to close it in Finder, or you could kill the Finder application with killall Finder

  4. DJ says:

    Works perfectly! Thanks for your help…

  5. dirtycold says:

    thank you. :)

  6. mb says:

    thank you. :)

  7. […] option is to use the command line and open to bring the root directory into the GUI through […]

  8. […] Open Current Folder in Finder from the Terminal Categories: Apple, […]

  9. john says:

    life saver!

  10. […] Oops looks like David covered this a month ago: Open Current Folder in Finder from the Terminal, Thanks for pointing this out […]

  11. […] Shared Open Current Folder in Finder from the Terminal. […]

  12. […] Shared Open Current Folder in Finder from the Terminal. […]

  13. Leho Kraav says:

    how do you do it the other way around – i often want to open Terminal at the path open in Finder.

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

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

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site