Command Line Navigation Flashcards
7 cards from real 010-160 practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Command Line Navigation flashcards as text
Which special shell variable holds the exit status of the last executed command?
Answer: $?
`$?` contains the exit status of the most recently executed foreground command; 0 means success.
What does pressing Tab once do in the bash shell when typing a command?
Answer: Attempts to auto-complete the command or filename
Tab completion in bash automatically completes the command name, filename, or path if there is an unambiguous match.
Which command shows the manual page (documentation) for a given command?
Answer: man
`man ` opens the manual page for that command, providing detailed usage information and options.
In the output of `ls -l`, what does the first character of the permission string indicate?
Answer: The file type (e.g., - for regular, d for directory)
The first character in `ls -l` output indicates the file type: `-` for regular file, `d` for directory, `l` for symbolic link.
Which key combination cancels the current command line input in bash?
Answer: Ctrl+C
Ctrl+C sends SIGINT to the foreground process, canceling the current command or interrupting a running program.
What is the purpose of the `which` command?
Answer: Locates the executable file for a given command
`which ` searches the directories in $PATH and prints the full path of the executable that would be run.
How do you display the last 10 commands from your shell history?
Answer: history | tail
`history | tail` pipes the history list to `tail`, which by default shows the last 10 lines.