Tips or general information

Useful infos from MacWeb

Use the terminal on macOS

Shared by on Feb 09, 2022

The terminal is a command-line interface that allows you to interact with your macOS operating system using text-based commands. To use the terminal on macOS:

Open the terminal: You can open the terminal by going to the "Utilities" folder in your "Applications" directory and double-clicking the "Terminal" application. Alternatively, you can use the "Spotlight" search feature to search for "Terminal" and open it that way.

Enter a command: Once the terminal is open, you can enter a command by typing it into the terminal window and pressing the "Enter" key. For example, you can use the "pwd" command to print the current working directory, or the "ls" command to list the files in the current directory.

Run multiple commands: You can run multiple commands by separating them with a semicolon (;). For example:

 pwd; ls

This will run the "pwd" command first, and then the "ls" command.

Use command arguments: Many terminal commands accept arguments, which are additional pieces of information that modify the behavior of the command. For example, the "ls" command can accept the "-l" argument to display the files in a long format, including additional details such as the file permissions and size. To use an argument with a command, you can type the command followed by the argument, like this:a

ls -l

Use command options: Some terminal commands also accept options, which are additional parameters that can be used to modify the behavior of the command. Options are typically specified using a single hyphen followed by a letter or word. For example, the "ls" command can accept the "-a" option to show hidden files, like this

ls -a

Use command shortcuts: The terminal includes a number of shortcuts that can make it easier to navigate and use. For example, you can use the "Tab" key to auto-complete a command or file name, or use the "Up" and "Down" arrow keys to navigate through your command history.
There are many other terminal commands and features available, and you can learn more by using the "man" command to view the manual pages for a command, or by searching online for tutorials and documentation.

  • Tips