Free 101-500 Sample Questions — LPIC-1 Exam 101

Free 101-500 sample questions for the LPIC-1 Exam 101 exam. No account required: study at your own pace.

Want an interactive quiz? Take the full 101-500 practice test

Looking for more? Click here to get the full PDF with 119+ practice questions for $10 for offline study and deeper preparation.

Question 1

Running chmod 640 filea.txt as a regular user doesn't update filea.txt's permission. What might be a reason why chmod cannot modify the permissions? (Choose two.)

  • A. filea.txt is owned by another user and a regular user cannot change the permissions of another user's file
  • B. filea.txt is a symbolic link whose permissions are a fixed value which cannot be charged
  • C. filea.txt has the sticky bit set and a regular user cannot remove this permission
  • D. filea.txt is a hard link whose permissions are inherited from the target and cannot be set directly
  • E. filea.txt has the SetUID bit set which imposes the restriction that only the root user can make changes to the file
Show Answer
Correct Answer:
  • A. filea.txt is owned by another user and a regular user cannot change the permissions of another user's file
  • B. filea.txt is a symbolic link whose permissions are a fixed value which cannot be charged
Question 2

Which of the following statements is correct for a command ending with an & character?

  • A. The command's output is redirected to /dev/null
  • B. The command is run in background of the current shell
  • C. The command's output is executed by the shell
  • D. The command is run as a direct child of the init process
  • E. The command's input is read from /dev/null
Show Answer
Correct Answer:
B. The command is run in background of the current shell
Question 3

Which of the following commands creates or, in case it already exists, overwrites a file called data with the output of ls?

  • A. ls 3> data
  • B. ls >& data
  • C. ls > data
  • D. ls >> data
  • E. ls >>> data
Show Answer
Correct Answer:
C. ls > data
Question 4

Which of the following commands can be used to determine how long the system has been running? (Choose two.)

  • A. uptime
  • B. up
  • C. time --up
  • D. uname -u
  • E. top
Show Answer
Correct Answer:
  • A. uptime
  • E. top
Question 5

Which of the following commands reads a file and creates separate chunks of a given size from the file's contents?

  • A. ar
  • B. cat
  • C. break
  • D. split
  • E. parted
Show Answer
Correct Answer:
D. split
Question 6

When considering the use of hard links, what are valid reasons not to use hard links?

  • A. Hard links are not available on all Linux systems because traditional filesystems, such as ext4, do not support them
  • B. Each hard link has individual ownership, permissions and ACLs which can lead to unintended disclosure of file content
  • C. Hard links are specific to one filesystem and cannot point to files on another filesystem
  • D. If users other than root should be able to create hard links, suln has to be installed and configured
  • E. When a hard linked file is changed, a copy of the file is created and consumes additional space
Show Answer
Correct Answer:
C. Hard links are specific to one filesystem and cannot point to files on another filesystem
Question 7

After a power outage, the XFS file system of /dev/sda3 is inconsistent. How can the existing file system errors be fixed?

  • A. By using mount -f to force a mount of the file system
  • B. By running xfsck on the file system
  • C. By mounting the file system with the option xfs_repair
  • D. By running xfsadmin repair on the file system
  • E. By running xfs_repair on the file system
Show Answer
Correct Answer:
E. By running xfs_repair on the file system
Question 8

Which of the following commands determines a file's format by using a definition database file which contains information about all common file types?

  • A. type
  • B. file
  • C. magic
  • D. pmagic
  • E. hash
Show Answer
Correct Answer:
B. file
Question 9

Which of the following commands is used to change options and positional parameters within a running Bash shell?

  • A. history
  • B. setsh
  • C. bashconf
  • D. set
  • E. envsetup
Show Answer
Correct Answer:
D. set
Question 10

Which of the following commands print the current working directory when using a Bash shell? (Choose two.)

  • A. echo "${PWD}"
  • B. echo "${WD}"
  • C. printwd
  • D. pwd
  • E. echo "${pwd}"
Show Answer
Correct Answer:
  • A. echo "${PWD}"
  • D. pwd
Question 11

What is true regarding the command ls > files if files does not exist?

  • A. The output of ls is printed to the terminal
  • B. files is created and contains the output of ls
  • C. An error message is shown and ls is not executed
  • D. The command files is executed and receives the output of ls
  • E. Any output of ls is discarded
Show Answer
Correct Answer:
B. files is created and contains the output of ls
Question 12

In a nested directory structure, which find command line option would be used to restrict the command to searching down a particular number of subdirectories?

  • A. -maxdepth
  • B. -dirmax
  • C. -maxlevels
  • D. -s
  • E. -n
Show Answer
Correct Answer:
A. -maxdepth
Question 13

Which of the following apt-get subcommands installs the newest versions of all currently installed packages?

  • A. auto-update
  • B. dist-upgrade
  • C. full-upgrade
  • D. install
  • E. update
Show Answer
Correct Answer:
B. dist-upgrade
Question 14

Consider the following directory: drwxrwxr-x 2 root sales 4096 Jan 1 15:21 sales Which command ensures new files created within the directory sales are owned by the group sales? (Choose two.)

  • A. chmod g+s sales
  • B. setpol -R newgroup=sales sales
  • C. chgrp -p sales sales
  • D. chown --persistent *.sales sales
  • E. chmod 2775 sales
Show Answer
Correct Answer:
  • A. chmod g+s sales
  • E. chmod 2775 sales
Question 15

Which of the following commands changes all CR-LF line breaks in the text file userlist.txt to Linux standard LF line breaks and stores the result in newlist.txt?

  • A. tr -d '\r' < userlist.txt > newlist.txt
  • B. tr -c '\n\r' '' userlist.txt
  • C. tr '\r\n' '' newlist.txt
  • D. tr '\r' '\n' userlist.txt newlist.txt
  • E. tr -s '/^M/^J/' userlist.txt newlist.txt
Show Answer
Correct Answer:
A. tr -d '\r' < userlist.txt > newlist.txt
Question 16

Which of the following tools can show the complete path of an executable file that the current shell would execute when starting a command without specifying its complete path? (Choose two.)

  • A. find
  • B. pwd
  • C. which
  • D. locate
  • E. type
Show Answer
Correct Answer:
  • C. which
  • D. locate
Question 17

Which of the following commands display the IDs of all processes owned by root? (Choose two.)

  • A. pgrep -c root
  • B. pgrep -u root
  • C. pgrep -f root
  • D. pgrep -U 0
  • E. pgrep -c 0
Show Answer
Correct Answer:
  • B. pgrep -u root
  • D. pgrep -U 0
Question 18

Which of the following Linux filesystems preallocate a fixed number of inodes when creating a new filesystem instead of generating them as needed? (Choose two.)

  • A. JFS
  • B. ext3
  • C. XFS
  • D. ext2
  • E. procfs
Show Answer
Correct Answer:
  • B. ext3
  • D. ext2
Question 19

Which is the default percentage of reserved space for the root user on new ext4 filesystems?

  • A. 10%
  • B. 3%
  • C. 15%
  • D. 0%
  • E. 5%
Show Answer
Correct Answer:
E. 5%
Question 20

Given a log file loga.log with timestamps of the format DD/MM/YYYY:hh:mm:ss, which command filters out all log entries in the time period between 8:00 am and 8:59 am?

  • A. grep -E ':08:[09]+:[09]+' loga.log
  • B. grep -E ':08:[00]+' loga.log
  • C. grep -E loga.log ':08:[0-9]+:[0-9]+'
  • D. grep loga.log ':08:[0-9]:[0-9]'
  • E. grep -E ':08:[0-9]+:[0-9]+' loga.log
Show Answer
Correct Answer:
E. grep -E ':08:[0-9]+:[0-9]+' loga.log

Aced these? Get the Full Exam

Download the complete 101-500 study bundle with 119+ questions in a single printable PDF.