Using Terminal for Mac is actually not difficult, you can use it on a daily basis by mastering the basic operations. 1. The opening methods include Spotlight search, searching in utility tools or adding to Dock; 2. Common commands include ls column directory, cd switch path, pwd display path, mkdir new folder, open . Open Finder; 3. Installation programs such as Homebrew need to run the official website command, and then use brew install to install the tool and remember to update; 4. Custom settings can be customized, such as Oh My Zsh beautifying the interface, setting aliases commands, and Tab completes the path to improve efficiency.
Terminal (terminal) for Mac is actually not that mysterious, it is just a tool that can directly "talk" to the system. As long as you master a few basic operations, it is quite convenient to use in daily life.

1. How to open Terminal
The easiest way to open Terminal is to search with Spotlight: Press Command 空格
and enter "Terminal" to enter. It can also be found in "Applications> Utility". You can also add it to the Dock, or set a shortcut key, such as using the third-party tool Alfred to quickly call it out.

- If you use terminals frequently, you can consider changing the default shell, such as changing from bash to zsh (macOS Catalina and the default version is zsh)
- You can also customize the theme to make the interface clearer or more suitable for nighttime use
2. Common commands and uses
When you first open Terminal, you will see a flashing cursor waiting for you to enter the command. The following commands are the most commonly used:
-
ls
: List files and folders in the current directory -
cd
: Switch the directory, for example,cd Desktop
is to enter the desktop -
pwd
: Show the current path -
mkdir
: Create a new folder, such asmkdir new_folder
-
open .
: Open the Finder window where the current directory is located (very convenient)
If you enter the wrong command, press Ctrl C
to interrupt the current operation.

3. How to install and run programs
Some software can only be installed through Terminal, such as Homebrew, Python scripts, Node.js tools, etc.
For example, install Homebrew (a package manager commonly used on Mac), and you can copy the line of command given by the official website and paste it in and execute it. After that, you can use brew install
to install various tools.
- After installation, remember to run
brew update
to update - If you use Apple Silicon (M1/M2 chip), some commands may require a slight adjustment of the path or run with Rosetta compatible
4. Tips for customizing and improving efficiency
Terminal's default appearance is a bit monotonous, but it can actually be set in personalized, such as changing the font color, autocompletion, history, etc.
- Installing Oh My Zsh can make your terminal more useful and more beautiful
- Setting an alias can abbreviate long commands, such as shrinking
git status
gs
- Use the Tab key to automatically complete the path, so as to save letters
Basically that's it. At the beginning, you may feel that the commands are difficult to remember, but if you practice a few more times, you will find that it is not that complicated. It’s just that many people didn’t dare to touch them at the beginning.
The above is the detailed content of How to use Terminal on Mac. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

To use the iPad as a Mac sub-screen, you can use the Sidecar function. The steps are as follows: First, make sure the device meets the requirements (Mac will run macOSCatalina and above after 2016, and iPad requires iPadOS13 or above); then go to "System Settings" > "Display" on the Mac, click "Add Monitor" and select iPad to connect; if it is unable to connect, you need to check whether Wi-Fi and Bluetooth are on, and make sure the two devices are in the same network environment. In terms of connection mode, wireless is suitable for daily office work but may have delays, while wired is more stable and supports charging. The display mode is divided into two types: extension and mirroring. It is recommended to use extension mode to improve work efficiency. In addition, it can also be achieved through preferences

To share files between two Macs on the same network, first make sure that the two devices are connected to the same LAN, then enable file sharing on the host, set shared folders and access permissions, and then connect from another Mac through the access sidebar or manually enter the SMB address, and finally you can browse, copy or transfer files. Common problems include waiting or restarting the network when the device cannot be discovered. If the permissions are incorrect, you need to check the username, password and sharing settings. If the connection fails, you can try the SMB address. If the firewall blocks, you can temporarily close the test.

To free up Mac storage space, you can use three methods to find and process large files: 1. Use the system's own storage management tool to view the "big file" list in "About Native" - ??"Storage"; 2. Set file size and modification time in Finder to search for large files; 3. Use third-party tools such as DaisyDisk, OmniDiskSweeper or GrandPerspective to scan and visualize disk usage. Each method has its own advantages, the system tools are convenient and fast, Finder provides more accurate search options, and third-party software provides stronger analysis functions. Remember to clear the wastebasket after deleting it to avoid remaining space.

When typing on a Mac using a Windows keyboard, the Win key corresponds to the Command key and the Alt key corresponds to the Option key; 1. Understand the key mapping: The Win key replaces the Command key for commonly used shortcut keys such as Command C/V, the Alt key replaces the Option key for special symbol input, and the right Alt key may be mapped to Control or other functions; 2. Adjust the keyboard mapping can be customized through system settings or third-party tool Karabiner-Elements; 3. In terms of function keys and multimedia key support, the F key needs to be used with the Fn key, the default brightness and volume function can be adjusted, and some brand shortcut keys are incompatible and need to be customized; 4. Common shortcut key comparison includes copy and paste.

Latency or lag on a Bluetooth mouse on a Mac is usually caused by a variety of factors, including wireless interference, low battery, system problems, or multi-device connection overload. 1. Wireless device interference: Keep Mac and mouse away from interference sources such as routers, USB3.0 devices, or switch Wi-Fi to 5GHz band. 2. Mouse battery level is insufficient: Check the battery status and replace the battery through the system settings or the mouse’s own indicator light. 3. The system or Bluetooth driver is not updated: Go to system settings to update macOS and try to reset the Bluetooth module through the debug menu. 4. Too many Bluetooth devices: disconnect unused peripherals, or use a Bluetooth USB adapter to share the load. Gradually checking the above problems can effectively solve the phenomenon of mouse lag.

To capture a specific area on your Mac, you can use the system shortcut key Shift Command 4 to enter the area screenshot mode, drag and select the area and release it to save to the desktop; if you need more options, press Shift Command 5 to open the screenshot tool, click "CaptureSelectedPortion" to take the area screenshot, and set the saving path and display the mouse pointer; a thumbnail will appear in the lower right corner after the screenshot, click to edit and mark it, and save it after completion.

MigrationAssistantonMacisabuilt-intoolusedtotransferfiles,accounts,apps,andsettingsfromanoldMac,PC,oranotheruseraccount.1.IthelpssetupanewMacquicklywithoutmanualcopyingorreconfiguration.2.Commonusesincludesettingupanewdevice,recoveringdataafteraclean

TheVSCodeterminalnotworkingisoftenduetoafrozenterminal,misconfiguredshellsettings,conflictingextensionsorstartupscripts,oracorruptedcache/installation.1.FirstcheckiftheterminalisfrozenbytypingacommandlikelsordirandpressingEnter;ifunresponsive,closean
