How to Open Any Folder in Finder from Mac Terminal
The standard way to open any directory on a Mac is by opening a Finder window and using it to navigate to a specific location on your hard drive. However, there’s also an alternate way to open folders – by using Terminal. While this isn’t something that will be used in your daily routine, if you are a developer (or someone who uses the Terminal frequently), this trick can be very useful.
Here we’ll show you how to use the open command to open any directory directly from Terminal, bypassing Finder.
1. Open Terminal on your Mac. This can be done by using Spotlight or by navigating to “Applications -> Utilities.”
2. In Terminal, we’ll now use the open command. The general syntax for this command is as follows:
For example, if I want to open the Documents folder directly from Terminal, my syntax would look like:
This will open the Documents folder in a Finder window, which you can then use to access the files in it.
To open the Root Directory in Finder, use the following command:
Similarly, to open the User Home folder (which contains the Desktop, Documents, Pictures folders, etc.), simply type in the following command in Terminal:
If you’re a programmer and are using Terminal to navigate through various system files and suddenly find the need to open a specific file you’ve found in Terminal, you can easily use the following command to do so:
This will open the specific folder directly in Finder where you can make any modifications you may need to.
All the commands mentioned above can be used to open specific directories or system resources, but you can also directly launch applications or utilities from the Terminal command line without using Finder. For example, if I wanted to open Safari directly from Terminal, I’d type in:
Use similar commands specifying the application location and name followed by “.app” to open any application on your Mac.
Open Folder in Terminal
Conversely, if you are in a folder in Finder and want to open it in Terminal, you can easily add a right-click shortcut to do so.
1. Open System Preferences on your Mac.
2. Navigate to “Keyboard -> Shortcuts.”
3. From the Services menu, enable “New Terminal at Folder.” This will automatically add the option to open the folder in Terminal to the Services menu. You can also set a keyboard shortcut for this for quicker access.
4. Now whenever you select any folder you’d like to open in Terminal, simply select “New Terminal at Folder,” and it’ll open the folder location in Terminal.
Using the commands and shortcuts above, you’ll hopefully be able to use Terminal more efficiently. Let us know of any questions or comments in the below.
Shujaa Imran is MakeTechEasier’s resident Mac tutorial writer. He’s currently training to follow his other passion become a commercial pilot. You can check his content out on Youtube
Open terminal here in Mac OS finder [closed]
Is there something similar to the «Open Command Window Here» Windows Powertoy for Mac OS? I’ve found a couple plugins through a google search but wanted to see what works best for developers out there.
14 Answers 14
As of Mac OS X Lion 10.7, Terminal includes exactly this functionality as a Service. As with most Services, these are disabled by default, so you’ll need to enable this to make it appear in the Services menu.
System Preferences > Keyboard > Shortcuts > Services
Enable New Terminal at Folder. There’s also New Terminal Tab at Folder, which will create a tab in the frontmost Terminal window (if any, else it will create a new window). These Services work in all applications, not just Finder, and they operate on folders as well as absolute pathnames selected in text.
You can even assign command keys to them.
Services appear in the Services submenu of each application menu, and within the contextual menu (Control-Click or Right-Click on a folder or pathname).
The New Terminal at Folder service will become active when you select a folder in Finder. You cannot simply have the folder open and run the service «in place». Go back to the parent folder, select the relevant folder, then activate the service via the Services menu or context menu.
In addition, Lion Terminal will open a new terminal window if you drag a folder (or pathname) onto the Terminal application icon, and you can also drag to the tab bar of an existing window to create a new tab.
Finally, if you drag a folder or pathname onto a tab (in the tab bar) and the foreground process is the shell, it will automatically execute a «cd» command. (Dragging into the terminal view within the tab merely inserts the pathname on its own, as in older versions of Terminal.)
You can also do this from the command line or a shell script:
This is the command-line equivalent of dragging a folder/pathname onto the Terminal application icon.
Open Current Folder in Finder from Terminal of Mac 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:
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.
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:
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!
7 simple ways to open Terminal on Mac
Terminal is a handy tool for giving your Mac commands although many may be intimidated by it. After all, it’s not as easy as just typing in a sentence and your Mac responding. We have some articles listed below that can help you with common commands if you’re interested in learning to use Terminal or if you just want to enter a command or two.
Either way, before you can use it, you have to open it, right? There are various methods for opening it; here are seven simple ways to open Terminal on Mac.
Open Terminal using Spotlight Search
One of the quickest and easiest ways to open Terminal on Mac is with Spotlight Search.
1) If you have the Spotlight Search button in your menu bar, click it. Otherwise, you can use the keyboard shortcut Command + Space.
2) Type in “Terminal”.
3) You should see the Terminal application under Top Hit at the top of your results. Double-click it and Terminal will open.
Open Terminal using Finder
Open Finder or make sure that your menu bar is using Finder and not another application.
1) Click Go > Utilities from the menu bar.
2) In the Utilities folder that opens, double-click Terminal.
Open Terminal using the Applications folder
If you have a Finder window open, you can access Terminal from the Applications folder.
1) Select Applications from the left side.
2) Click the arrow to expand the Utilities folder.
3) Double-click Terminal.
If you have the Applications folder in your Dock like I do, you can open Terminal from there too.
1) Click Applications in your dock.
2) Select Utilities.
3) Choose Terminal.
Open Terminal using Launchpad
You can open Terminal using Launchpad two ways, depending on if you have organized Launchpad a different way or not.
By default, Launchpad contains a folder labeled Other that contains Terminal.
1) Open Launchpad from your Dock or with the keyboard shortcut Fn + F4.
2) Locate the Other folder and click.
3) Choose Terminal.
If you have arranged your Launchpad items differently and removed the Other folder, you can still find Terminal easily.
1) Open Launchpad from your Dock or with the keyboard shortcut Fn + F4.
2) Type “Terminal” into the search box at the top.
3) When the Terminal icon displays, click it.
Open Terminal using Siri
Thanks to a helpful comment from one of our readers, there is one more super simple to way to open Terminal on Mac; using Siri.
1) Click the Siri button from your menu bar or open Siri from your Applications folder.
2) Using your microphone, simply say “Open Terminal.”
Create a Terminal shortcut
If you decide that you want to start using Terminal more often, creating a shortcut for it in your Dock is convenient.
With the Terminal icon in your Dock already, from recently opening it, do the following.
1) Hold Control and click the Terminal icon in the Dock or right-click it.
2) Mouse over Options in the pop-up menu.
3) Click Keep in Dock.
Terminal commands and tips
As mentioned above, here are some of our articles with commands you can use for Terminal that may come in handy.
You can also head to the Terminal section of our website for additional tips and tutorials for Terminal.
Wrapping it up
Terminal is a terrific tool for doing things quickly on your Mac. And once you get the hang of it, and bookmark some useful commands, it’s not as intimidating anymore.
Have you tried to use Terminal yet or are you interested in learning more about it so that you can use it? Let us know your thoughts below and if you have any tips you’d like to share with our readers for using Terminal, feel free to comment!