Open any folder from the Terminal app in a Finder on macOS
Published on Jul 21, 2022
2 min read
Often, I struggle or want to open the current directory I am working from the Terminal app to the Finder window on macOS.
I have been a macOS user for almost eight years now, and it never occurred to me that I couldn't open the current location from the Terminal app. Until recently, a frustration point led me to find the solution. Again, though, I am surprised by its simplicity.
To open the current working directory in the Finder window, use the following command:
open command opens a file or a folder. It exists on the macOS.
You can do more with this command. The
/ argument opens the root directory.
A specific directory is also allowed:
Using the option
R, you can locate a specific file or folder in the Finder:
open -R /blog
There are more things that the
open command can do. It can open files. For example, to open a markdown file in the default editor or IDE:
The above command opens the markdown file in the Xcode. You can pass the
-t option to open in the file in a text editor.
open -t ./blog/mm-yy/your-file-name.md
It can do more than open files and folders. It can also open a URL in the default web browser set up on your machine:
a to override the default web browser and specify a different one.
open -a Safari https://www.google.com
Browse all posts