How to open a folder on a Mac using a command in Terminal
The most common and basic way to open any folder in macOS is to go to Finder and navigate to its specific location on your hard drive.
There's also another way you can open whatever folder you want on your Mac: using Terminal.
Admittedly, accessing folders using Terminal is more complicated than navigating in Finder. So why spend more effort doing the same job? There are a few key benefits to using Terminal to open folders - things the Finder can't offer - at least in some specific situations.
How to open a folder from Terminal
To get started, open Terminal by navigating to the ' Application -> Utilities ' folder , or by typing 'Terminal' in Spotlight.
After the Terminal opens, you should basically be able to open any folder from the Mac Terminal using specific commands. The general syntax is as follows:
open /đường dẫn/đến/thư mục/
For example, to open the Pictures folder, you would use the following command:
open /Users/tênngườidùng/Pictures
This command will open the Pictures folder in a Finder window. You can then use it to access the files contained in the folder.
There are also a bunch of other short commands you can use to access specific directories. For example:
To open the Root folder, use the command:
open /
For your Home folder (i.e. the folder containing Desktop, Documents, and other user-specific folders), type:
open ~
To open the current working folder in Finder, use the command:
open .
Alternatively, you can also launch and update Mac apps from the Terminal without using Finder. For example, to open Safari, type:
open /Applications/Safari.app
You can of course replace Safari with any app on your system as long as you know its corresponding filename.
Open a folder in Terminal from the Shortcut Menu
Maybe you want to 'reverse the situation' and open a Finder folder in Terminal. In other words, make it your current working directory. This can be done by adding a shortcut that will appear when you right click.
Navigate to System ' Preferences -> Keyboard '.
Next, navigate to the Shortcuts tab . Here, click on the Services menu and scroll down to find the ' New Terminal at Folder ' option.
If you selected any of the folders in the Finder, open the Services menu from the Toolbar and choose ' New Terminal at Folder '.
This is especially useful if you frequently have to switch between the GUI and Terminal.
You should read it
May be interested
- Set up Windows Terminal to always open with Command Prompt on Windows 11windows terminal is one of the most useful applications in windows 11. it allows you to access different shell command environments, all in one extremely convenient and easy to operate.
- How to Change Default Folder in Windows Terminalby default, windows terminal will use your current user directory as the default directory when you open it. however, you can completely change this folder to any other folder on your windows pc.
- 6 interesting terminal commands on Macterminal is a handy utility, often found on unix-based computers, such as linux and macos. there are many interesting things to do in the terminal. regardless of your experience, you can use these great terminal commands on mac.
- 18 terminal commands on Chromebook you should knowdo you know that chromebooks have an integrated terminal? chrome os developer shell, or crosh for short, allows users to access the command line interface, which can be used for debugging, testing, etc.
- How to Open Folders in CMDdo you need to access something from the command prompt or the windows command prompt? although it looks classic, this program is really easy to use if you know some basic commands. today's tipsmake will show you how to use the 'cd' command to open a folder in windows command prompt. besides, you will also know more great tips to instantly open command prompt in any folder on windows file explorer.
- Notable changes in Windows Terminal ver 0.11windows terminal is a command-line interface application released by microsoft in late may 2019
- How to create and delete folders in Linux Terminalfolders are essential for your linux operating system because they contain files you may use often or that the system needs to function correctly.
- Common Terminal commands in Raspberry Piyou have a raspberry pi on hand, but not completely confident with linux? although the main desktop is easy to use, sometimes users need to rely on the command line entry in the terminal.
- How to open folders hidden on the system with the Shell command on Windows?on the operating system there are many hidden system folders that can be identified on the windows registry with the clsid key, the specific folder name and the folder location on your computer.
- How to Browse the Internet Using the Terminal in Linuxhave you ever wondered how to view web pages in a command line in linux? start with step one to learn how to do it, using two different tools. go to the terminal and type this command .