โ† All 010-160 Flashcard Decks

Linux Command Line & Shell Scripting 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 Linux Command Line & Shell Scripting flashcards as text
  1. Which shell built-in command displays the value of a variable named MYVAR?

    Answer: echo $MYVAR

    The echo command followed by the variable name prefixed with $ displays its value.

  2. What does the pipe operator | do in a shell command?

    Answer: Sends the output of one command as input to another

    The pipe | connects the stdout of the left command to the stdin of the right command.

  3. Which command lists only the directories inside /home?

    Answer: ls -d /home/*/

    ls -d /home/*/ matches only directory entries by appending a trailing slash glob.

  4. In a bash script, what does the special variable $? represent?

    Answer: The exit status of the last command

    $? holds the exit code returned by the most recently executed foreground command.

  5. Which command would you use to search for the string 'error' in all .log files under /var/log?

    Answer: grep -r 'error' /var/log/*.log

    grep with a pattern and a file glob searches for matching text within the specified files.

  6. What is the result of running: echo {a,b,c}.txt?

    Answer: Prints: a.txt b.txt c.txt

    Brace expansion generates the strings a.txt, b.txt, and c.txt, which echo then prints.

  7. Which redirection operator appends standard output to an existing file without overwriting it?

    Answer: >>

    The >> operator opens the file in append mode, adding new output after existing content.