Use the Command Line Interface Flashcards

1
Q

What are the 6 advantages of using the command-line interface (CLI)?

A
  1. Additional administrative and troubleshooting options
  2. More access to the file system
  3. A remote login using the Secure Shell (SSH) protocol.
  4. Any administrator can run commands as the system administrator (root) using “sudo”
  5. The ability to automate repetitive tasks using scripting by applying CLI syntax to a command-line script
  6. The ability to remotely administer multiple, even thousdans, of Macs computers simultaneously using Apple Remote Desktop (ARD)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a shell in regards to the CLI

A

A program that creates an interface to command a computer operating system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the default shell used in macOS Monterey for the CLI?

A

Z Shell (zsh)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 4 ways you can access the CLI?

A
  1. Terminal application
  2. Start Mac in macOS Recovery mode to open Terminal from the Utilities menu
  3. Start Mac up in Single User Mode
  4. SSH Remote login
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the 5 components of this terminal command prompt:

john@Johns-Macbook-Pro ~ %

A
  1. Current user account
  2. The @ symbol
  3. The name of the Mac you’re using
  4. Your location in the file system
  5. A special character that provides a hint about which shell you’re using
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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?

A

Z Shell: % (percentage symbol)

bash shell: $ (dollar sign symbol)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the four parts of a command string?

A
  1. Command name
  2. Command options
  3. Arguments
  4. Extras
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the command name?

A

A command that just needs their name to execute, for example: “ls” to display a list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the “options” part of the command string do?

A

Options add conditions, limits, or other modifiers to the command. Options start with two dashes to distinguish them from arguments.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the “arguments” part of the command string do?

A

This is the recipient of the command, often specified as a file or folder path.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the “extras” part of the command string do?

A

Redirected output, or the commands as needed. They can enhance the capabilities of a command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are Manual (man) Pages?

A

Manual pages include detailed information about commands and references to other commands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you access and navigate Manual (man) Pages

A

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”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the 5 main elements of a man page?

A
  1. Name (Commands name)
  2. Synopsis (formal description of how to run command)
  3. Description (more detailed description of the function of the command)
  4. Examples (show intended use and options. Not always present)
  5. See Also (shows similar commands)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the 10 other additional elements that may be included in a man page?

A
  1. Options
  2. Exit Status
  3. Return Value
  4. Environment
  5. Bugs
  6. Files
  7. Author
  8. Reporting Bugs
  9. History
  10. Copyright
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

True or False: The command line is not case-sensitive and doesn’t require you to use full filenames with filename extensions.

A

False

17
Q

What is a path, or pathname?

A

Represents a file or folder’s location in the file system

18
Q

What are the two types of pathnames?

A
  1. Absolute paths

2. Relative paths

19
Q

What is an absolute path and what does it start with?

A

A full descriptions of an item location, starting from the root of the system volume.
Starts with a forward slash to indicate the beginning of the file system.

20
Q

What is a relative path?

A

They are partial descriptions of an item location that are based on where you’re currently working in the file system.

21
Q

Terminal Command for: print working directory

A

pwd

22
Q

Terminal Command for: list

A

ls

23
Q

Terminal Command for: change directory

A

cd

24
Q

Terminal Command for: indicate parent folder

A

. . (double periods)

25
Q

Terminal Command for: indicate the current user’s home folder

A

~ (tilde)

26
Q

Terminal Command for: create a folder

A

mkdir

27
Q

Terminal Command for: run the command with root account access

A

sudo

28
Q

Terminal Command for: clear the terminal screen

A

clear OR press “Control + L”

29
Q

Terminal Command for: search for files with the spotlight index

A

mdfind

30
Q

Terminal Command for: copy items from once place to another

A

cp (copy)

31
Q

Terminal Command for: update the medication date of a specified item

A

touch

32
Q

Terminal Command for: move items from one place to another

A

mv (move)

33
Q

Terminal Command for: permanently delete items

A

rm (remove)

34
Q

Terminal Command for: permanently delete folders

A

rmdir (remove directory)

35
Q

Terminal Command for: substitute user identity or super user

A

“su” followed by the user you want to switch to

36
Q

Which key should you use if you want to automatically complete filenames, pathnames, and command names?

A

The tab key