Use the Command Line Interface Flashcards
What are the 6 advantages of using the command-line interface (CLI)?
- Additional administrative and troubleshooting options
- More access to the file system
- A remote login using the Secure Shell (SSH) protocol.
- Any administrator can run commands as the system administrator (root) using “sudo”
- The ability to automate repetitive tasks using scripting by applying CLI syntax to a command-line script
- The ability to remotely administer multiple, even thousdans, of Macs computers simultaneously using Apple Remote Desktop (ARD)
What is a shell in regards to the CLI
A program that creates an interface to command a computer operating system.
What is the default shell used in macOS Monterey for the CLI?
Z Shell (zsh)
What are the 4 ways you can access the CLI?
- Terminal application
- Start Mac in macOS Recovery mode to open Terminal from the Utilities menu
- Start Mac up in Single User Mode
- SSH Remote login
What are the 5 components of this terminal command prompt:
john@Johns-Macbook-Pro ~ %
- Current user account
- The @ symbol
- The name of the Mac you’re using
- Your location in the file system
- A special character that provides a hint about which shell you’re using
What is the special symbol that macOS Monterey uses in the Z shell? What is the symbol you would see if you were using the bash shell from macOS Catalina or previous versions by default?
Z Shell: % (percentage symbol)
bash shell: $ (dollar sign symbol)
What are the four parts of a command string?
- Command name
- Command options
- Arguments
- Extras
What is the command name?
A command that just needs their name to execute, for example: “ls” to display a list.
What does the “options” part of the command string do?
Options add conditions, limits, or other modifiers to the command. Options start with two dashes to distinguish them from arguments.
What does the “arguments” part of the command string do?
This is the recipient of the command, often specified as a file or folder path.
What does the “extras” part of the command string do?
Redirected output, or the commands as needed. They can enhance the capabilities of a command.
What are Manual (man) Pages?
Manual pages include detailed information about commands and references to other commands.
How do you access and navigate Manual (man) Pages
Type “man” followed by the name of the command.
To Navigate: use the up and down arrow keys to scroll, use the space bar to move down on screen at a time, enter a forward slash then a keyword, then press Return to search through a man page, and to exit the man page, type “q”
What are the 5 main elements of a man page?
- Name (Commands name)
- Synopsis (formal description of how to run command)
- Description (more detailed description of the function of the command)
- Examples (show intended use and options. Not always present)
- See Also (shows similar commands)
What are the 10 other additional elements that may be included in a man page?
- Options
- Exit Status
- Return Value
- Environment
- Bugs
- Files
- Author
- Reporting Bugs
- History
- Copyright