Linux Essentials Certificate Exam v1.6 Free Sample Questions

20 free sample questions285 in the full practice test Other version: 010-150(240)

Try simulator

010-160 Sample Questions

  1. Question 1

    Which of the following examples shows the general structure of a for loop in a shell script?

    Answer and explanation

    Correct answer: C

    The correct syntax for a for loop in shell scripting uses the format 'for variable in list; do commands; done'. This structure includes the loop variable (file), the list to iterate over (*.txt), the do keyword to start the command block, and done to end the loop. The other options show incorrect syntax: using => instead of do, parentheses instead of do/done, exec which is for find command, and foreach which is not valid shell syntax.

  2. Question 2

    Multiple answers

    Which of the following commands output the content of the file Texts 2.txt? (Choose two.)

    Answer and explanation

    Correct answers: A, B

    File names containing spaces must be properly quoted or escaped to prevent the shell from interpreting them as separate arguments. Single quotes around the entire filename ('Texts 2.txt') preserve the space literally, while backslash escaping (Texts\ 2.txt) escapes the space character. The other options are invalid: double dashes, square brackets, and missing escape characters will cause command failures.

  3. Question 3

    Which of the following commands creates an archive file work.tar from the contents of the directory ./work/?

    Answer and explanation

    Correct answer: B

    The tar command uses '-c' to create an archive and '-f' to specify the output filename, making 'tar -cf work.tar ./work/' the correct syntax. The -c flag means create, and -f specifies the archive file name. Other options use invalid flags like -new or -create (which don't exist), incorrect syntax with redirections, or wrong file extensions like .tgz without compression flags.

  4. Question 4

    Where is the operating system of a Raspberry Pi stored?

    Answer and explanation

    Correct answer: C

    Raspberry Pi systems boot from a removable SD card that contains the operating system, bootloader, and file system. This design allows easy OS installation, backup, and swapping between different configurations. Unlike traditional computers, Raspberry Pi does not have internal storage, IDE buses, or built-in flash memory for the OS. The GPIO pins are for hardware interfacing, not storage.

  5. Question 5

    Multiple answers

    Which of the following tar options handle ocmpression? (Choose two.)

    Answer and explanation

    Correct answers: B, D

    The tar command supports compression through the -z flag (gzip compression) and -j flag (bzip2 compression). These flags automatically compress the archive during creation or decompress during extraction. The -z option is faster but provides less compression, while -j provides better compression but takes more time. Options like -bz, -g, and -z2 are not valid tar compression flags.

  6. Question 6

    Which of the following commands adds the directory /new/dir/ to the PATH environment variable?

    Answer and explanation

    Correct answer: E

    To prepend a directory to the PATH environment variable, use 'export PATH=/new/dir:/Users/umar/.codeium/windsurf/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.4.0/bin:/Users/umar/.cargo/bin:/Users/umar/.local/bin:/Users/umar/.cargo/bin:/Users/umar/.local/bin:/opt/homebrew/bin:/Users/umar/go/bin:/Applications/Docker.app/Contents/Resources/bin:/Users/umar/.nvm/versions/node/v22.0.0/bin:/Users/umar/miniconda3/bin:/Users/umar/miniconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/share/dotnet:/Users/umar/.dotnet/tools:/Users/umar/.cargo/bin:/Users/umar/.local/bin:/Users/umar/.local/bin' which adds the new directory at the beginning of the existing PATH. The export command makes the variable available to child processes, and the colon separates PATH entries. Other options have syntax errors: missing export, incorrect variable assignment syntax, or using semicolons instead of colons as separators.

  7. Question 7

    Which of the following commands puts the lines of the file data.csv into alphabetical order?

    Answer and explanation

    Correct answer: B

    The sort command arranges lines of text in alphabetical order by default, making 'sort data.csv' the correct answer for sorting a CSV file. The sort command reads the input file and outputs the lines in sorted order. Other options are invalid: 'alpha', 'order', and 'sortlines' are not standard Linux commands for sorting file contents.

  8. Question 8

    A user is currently in the directory /home/user/downloads/ and runs the command

    Is ../Documents/

    Assuming it exists, which directory’s content is displayed?

    Answer and explanation

    Correct answer: D

    When in /home/user/downloads/, the command 'ls ../Documents/' uses the relative path '..' to go up one directory level to /home/user/, then navigates to the Documents subdirectory, displaying the contents of /home/user/Documents/. The '..' notation represents the parent directory, making this relative path navigation from the current working directory.

  9. Question 9

    Which permissions are set on a regular file once the permissions have been modified with the command chmod 654 file.txt?

    Answer and explanation

    Correct answer: E

    Octal permission 600 represents read and write permissions for the file owner only (rw-------). The first digit (6) sets owner permissions: 4 (read) + 2 (write) = 6. The remaining digits (00) give no permissions to group and others. This is commonly used for private files like SSH keys or configuration files that should only be accessible by the owner.

  10. Question 10

    Which of the following statements is true about Free Software?

    Answer and explanation

    Correct answer: B

    The cat command displays the entire content of text files to standard output, making it useful for viewing small to medium-sized files. Unlike head or tail which show partial content, cat shows the complete file from beginning to end. It can also concatenate multiple files when given multiple arguments. Other options like showing file size, permissions, or modification dates are handled by different commands like ls.

Register free to unlock 10 more sample questions

Lifetime One

Own this practice test forever.

$79.99
$75.99
one-time
  • Full access to 525 questions
  • Study, Timed & Flashcard Modes
  • All past and future versions i
  • Detailed Explanations
  • Study Tracking & Past Attempts
  • Brainy AI Assistant
  • Lifetime updates

Two

Any 2 exams per month.

$20.00/exam
$39.99
/month
  • 2 active exam slots
  • Study, Timed & Flashcard Modes
  • All past and future versions i
  • Detailed Explanations
  • Study Tracking & Past Attempts
  • 1,000 Brainy AI Credits
  • Cancel anytime

Premium Twelve

Any 12 exams over 3 months.

$15.00/exam
$179.99
/3 months
  • 4 active exam slots
  • Study, Timed & Flashcard Modes
  • All past and future versions i
  • Detailed Explanations
  • Study Tracking & Past Attempts
  • 15,000 Brainy AI Credits
  • Dedicated support
  • Friend seat included — full access

Trusted by professionals at

NvidiaSupabaseGitHubOpenAITursoClerkClaude AIAmazon