Command-Line Interface Flashcards
6 cards from real ACSP practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Command-Line Interface flashcards as text
Which Terminal command displays the manual page for another command?
Answer: man
'man' (manual) displays the detailed manual page for a given command, including syntax, options, and examples. For example, 'man ls' shows the full documentation for the ls command.
What does the 'sudo' command do in macOS Terminal?
Answer: Executes the following command with superuser (root) privileges
'sudo' (superuser do) runs the immediately following command with root privileges after authenticating with the current user's admin password. The elevated privilege applies only to that single command.
Which command would you use to change file permissions in macOS Terminal?
Answer: chmod
'chmod' (change mode) modifies the read, write, and execute permissions on files and directories. Permissions can be set using numeric (octal) notation like 755 or symbolic notation like u+x.
What is the function of the 'grep' command in macOS Terminal?
Answer: Search text using patterns and display matching lines from files or input
'grep' (Global Regular Expression Print) searches through text files or piped input for lines matching a specified pattern, printing those matching lines to the terminal output.
Which command displays the current user's username in macOS Terminal?
Answer: whoami
'whoami' prints the username of the currently logged-in user running the Terminal session. It's a quick way to verify which account context a command will run under.
What does piping (|) do in macOS Terminal commands?
Answer: Sends the standard output of one command as the standard input to the next command
The pipe character (|) connects commands in a chain, passing the standard output (stdout) of the command on the left as the standard input (stdin) of the command on the right, enabling powerful command combinations.