โ† 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 command substitution syntax stores the output of date into a variable TODAY?

    Answer: TODAY=$(date)

    $() performs command substitution, executing date and assigning its output to TODAY.

  2. What is the purpose of the shebang line #!/bin/bash at the top of a script?

    Answer: It specifies the interpreter that should execute the script

    The shebang tells the OS which interpreter to use when the script is executed directly.

  3. Which command displays the first 5 lines of a file named data.csv?

    Answer: head -5 data.csv

    head -n N (or the shorthand head -N) prints the first N lines of a file.

  4. In bash, what does the double bracket [[ ... ]] provide compared to single bracket [ ... ]?

    Answer: Double brackets support pattern matching and avoid word-splitting issues

    [[ ]] is a bash keyword offering regex matching, no word-splitting, and safer quoting than POSIX [ ].

  5. Which command would you use to find all files modified in the last 24 hours under /home?

    Answer: find /home -mtime -1

    find with -mtime -1 matches files whose modification time is less than 1 day (24 hours) ago.

  6. What does the cut -d: -f1 /etc/passwd command output?

    Answer: The first field (usernames) from each line of /etc/passwd

    cut -d: sets colon as the delimiter, and -f1 extracts the first field, which is the username.

  7. Which bash conditional correctly checks if a file named config.txt exists?

    Answer: if [ -f config.txt ]; then

    The -f test operator inside [ ] returns true if the specified path exists and is a regular file.