LPI Linux Essentials 010-160 Practice Exam Questions and Answers – Part 8/9

Practice for the LPI Linux Essentials exam with 13 exam-style practice questions, instant answer reveals, and concise explanations of every correct answer. Topics include: How can the normal output of a command be written to a file while discarding the error output?. Follow @CertPunch and visit certpunch.com for more certification practice exams and study content.

Prefer hands-on? Take this round as an interactive practice test — answer every question, get instant feedback, and see your score: Start the LPI Linux Essentials practice test →

What you will practice

  • How can the normal output of a command be written to a file while discarding the error output?
  • Which GID is usually used to represent the root group on a Linux system?
  • Which of the following answers is true for cloud computing?
  • Which of the following is the UNIX device name for a physical or virtual terminal connection?
  • Which of the following is the on-demand availability of computer system resources, especially data storage an…
  • Which command is used to rename a file on Linux?

Answers and explanations

Tap a question to expand the answer and the exam reasoning. Try to commit to your own pick first.

Q1. How can the normal output of a command be written to a file while discarding the error output?

Answer: D. command >file 2>/dev/null

Redirecting standard error to dev null immediately discards those error messages, while sending standard output to a file saves it. Standard error is represented by the file descriptor number two, which makes the two right angle bracket dev null syntax essential.

Q2. Which GID is usually used to represent the root group on a Linux system?

Answer: A. 0

The root group is always represented by the group identifier zero. Just as the root user account has user identifier zero, assigning zero to the primary group ensures the highest level of administrative system access.

Q3. Which of the following answers is true for cloud computing?

Answer: A. Cloud Computing provides new tools to manage IT resources

Cloud computing introduces new paradigms and tools for managing information technology resources efficiently. The other options present false assumptions, as moving to the cloud does not automatically mean downsizing your department or sharing data publicly.

Q4. Which of the following is the UNIX device name for a physical or virtual terminal connection?

Answer: D. tty

The term tty represents teletypewriter and serves as the standard Unix device name for physical or virtual terminal connections. Knowing this historical abbreviation is a practical cue for identifying command line interface environments in Linux.

Q5. Which of the following is the on-demand availability of computer system resources, especially data storage and computing power, without direct active management by the user?

Answer: C. Cloud Computing

Cloud computing provides on demand availability of computer system resources like data storage and computing power without direct active management. While other terms sound plausible, cloud computing is the industry standard term you need to know.

Q6. Which command is used to rename a file on Linux?

Answer: C. mv

The mv command is the standard utility used to both move and rename files within Linux. While a separate rename command exists, mv is the fundamental POSIX tool you must master for basic file manipulation on the exam.

Q7. Which of the following is true about environment variable names by convention?

Answer: A. Contains all uppercase letters

Environment variables are conventionally named using all uppercase letters to distinguish them from regular local shell variables. This naming convention helps system administrators and users easily identify system configurations like PATH or USER.

Q8. What does the "rm -rf" command do in Linux?

Answer: A. Remove all the files in the directory and subdirectories

The rm command with the recursive and force flags removes all files within a directory and its subdirectories without prompting. The lowercase r makes it traverse directories, while the f forces the action by ignoring non-existent files and overrides.

Q9. Which of the following commands increases the number of files within a directory?

Answer: C. touch newfile

The touch command updates timestamps, but if the file does not exist, it creates a new empty file, thereby increasing the file count. The create command is not a standard utility, and rmdir removes directories.

Q10. What keyword should be used to fill in the blank in the following segment of the given shell script? for i in *; _____ cat $i done

Answer: A. do

In bash scripting, a for loop requires the do keyword before the commands you want to execute. Remember the basic loop structure is for, followed by do, and ending with done.

Q11. Which of the following statements may be used to access the second command line argument to a script?

Answer: B. $2

Inside a script, the dollar sign followed by a number references positional parameters from the command line. For your exam, remember that dollar one is the first argument, while dollar two captures the second argument passed to the script.

Q12. Which command can be used to display the contents of multiple files to the screen at once?

Answer: C. cat

The cat command concatenates files and reads their contents sequentially to standard output. While head and tail are useful for viewing specific file sections, only cat seamlessly streams multiple complete files to the screen at once.

Q13. Which string should you add to put the date into the prompt of the shell?

Answer: D. \d

In the PS1 prompt string, the backslash d escape sequence displays the current date in a specific format. Watch out for slash variants on the exam, as bash prompt escapes universally rely on a backslash rather than a forward slash.

More LPI Linux Essentials drills and other practice exams are on @CertPunch. New rounds drop every few days at certpunch.com.

Scroll to Top