# Free 010-160 practice questions

> 10 free 010-160 practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/lpi-010-160/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/lpi-010-160/

### Question 1 of 10

A developer modifies a program licensed under the GNU GPL and distributes the modified binaries to customers. What does the license require?

- A. The corresponding source code of the modified version must be offered under the GPL
- B. Only the unchanged original files must be published, while newly added files may stay proprietary
- C. The modifications may stay closed as long as the original authors are credited in the documentation
- D. The modified program may be relicensed under any OSI-approved permissive license such as BSD

**Answer:** A

**Explanation:** The GPL is a copyleft license: anyone who distributes a modified version must make the complete corresponding source available under the same GPL terms. Keeping changes closed with an attribution is what some permissive licenses allow, not the GPL. A GPL work cannot be relicensed under BSD by a downstream developer, and the copyleft covers the whole derived work, not only the original files.

### Question 2 of 10 (choose 2)

A company wants to reuse open source libraries in a proprietary product without being required to publish the product's source code. Which two licenses are permissive and allow this? (Choose two.)

- A. Apache License 2.0
- B. GNU Affero General Public License v3
- C. GNU General Public License v3
- D. Creative Commons Attribution-ShareAlike
- E. BSD 3-Clause License

**Answer:** A, E

**Explanation:** The BSD and Apache 2.0 licenses are permissive: they require keeping copyright and license notices but allow use in closed-source products. GPLv3 and AGPLv3 are copyleft licenses that require derived works to be released under the same license (the AGPL even covers network use), and CC BY-SA has a share-alike clause and is intended for content rather than software.

### Question 3 of 10

Why should the pattern be quoted in the command find . -name '*.txt'?

- A. The quotes make find compare the file names without regard to letter case
- B. Unquoted, the shell may expand *.txt to file names in the current directory before find runs
- C. The quotes tell find to descend into hidden directories as well as normal ones
- D. find requires quotes around every argument that follows one of its options

**Answer:** B

**Explanation:** Globs are expanded by the shell, so if .txt files exist in the current directory find would receive their names instead of the pattern and search for the wrong thing or fail. Quoting passes the pattern to find, which matches it itself. Quotes are not otherwise required, case-insensitive matching uses -iname, and find already descends into hidden directories.

### Question 4 of 10

A user runs echo "Total: $5" in an interactive Bash shell and sees only Total: followed by a space. Why?

- A. echo treats any word that starts with a dollar sign as a comment and drops it
- B. Double quotes strip every special character, including the digits that follow them
- C. Inside double quotes $5 expands to the fifth positional parameter, which is empty
- D. The shell replaces $5 with the exit status of the fifth previous command

**Answer:** C

**Explanation:** Double quotes still allow parameter expansion, and $5 refers to the fifth positional parameter, which is unset in an interactive shell, so it expands to nothing. Single quotes or a backslash before the dollar sign would print it literally. Comments start with #, not $, double quotes preserve digits, and the exit status of the last command is $?.

### Question 5 of 10 (choose 2)

A script must run the command backup and print backup failed only when backup returns a nonzero exit status. Which two lines do this? (Choose two.)

- A. backup; if [ $? -ne 0 ]; then echo "backup failed"; fi
- B. while backup; do echo "backup failed"; done
- C. backup; if [ $? -eq 0 ]; then echo "backup failed"; fi
- D. if [ -z backup ]; then echo "backup failed"; fi
- E. if ! backup; then echo "backup failed"; fi

**Answer:** A, E

**Explanation:** if ! inverts the exit status so the message appears on failure, and testing $? -ne 0 right after the command checks for a nonzero status. -eq 0 prints the message on success, [ -z backup ] tests whether the literal string backup is empty instead of running the command, and the while loop repeats the message as long as backup succeeds.

### Question 6 of 10

Which pipeline prints each distinct login shell from /etc/passwd together with the number of accounts that use it?

- A. cut -f7 /etc/passwd | sort | uniq -c
- B. cut -d: -f7 /etc/passwd | uniq -c | sort -n
- C. cut -d: -f6 /etc/passwd | sort -u | wc -l
- D. cut -d: -f7 /etc/passwd | sort | uniq -c

**Answer:** D

**Explanation:** The seventh colon-separated field of /etc/passwd is the login shell; sort groups identical values together so uniq -c can count each one. uniq only merges adjacent duplicates, so running it before sort produces split counts. Without -d: cut uses tab as the delimiter and prints whole lines, and field 6 is the home directory, while sort -u | wc -l only counts distinct values.

### Question 7 of 10

On a server that has run for weeks, free -h shows very little free memory but a large buff/cache value and a high available value. What does this indicate?

- A. The cache lives on disk, so all of the RAM shown is actually unused
- B. A process has leaked memory that permanently occupies the cache area
- C. The system is about to run out of memory and needs more swap immediately
- D. The kernel uses spare RAM as cache and releases it when programs need memory

**Answer:** D

**Explanation:** Linux fills otherwise idle RAM with page cache and buffers to speed up disk access, and the available column estimates how much memory can still be given to programs by reclaiming that cache. A low free value alone is therefore normal, leaked memory would appear as used rather than cache, and buff/cache is held in RAM, not on disk.

### Question 8 of 10

ping -c 4 192.168.1.1 reports 100% packet loss, while ip addr show lists 192.168.1.20/24 on eth0 with state UP. What does this suggest?

- A. The local interface is configured, so the problem lies with the target or the path to it
- B. The local interface has no IP address and must request one from DHCP
- C. ping needs root privileges to send more than one echo request
- D. DNS resolution is failing, so /etc/resolv.conf must be corrected

**Answer:** A

**Explanation:** The interface is up with an address in the same subnet as the target, so the local configuration looks correct and the target host, a firewall or the cable or switch is the likely cause. An address is clearly assigned, no name is involved because an IP address was pinged, and regular users may send several echo requests with ping.

### Question 9 of 10

User bob cannot delete a file that alice created in /tmp, even though /tmp is writable by everyone. Why?

- A. The sticky bit on /tmp lets only the file's owner, the directory owner or root delete it
- B. Alice's umask removed write permission for others, and deleting a file needs write on the file
- C. The setuid bit on /tmp makes every new file inside it owned by root and read-only
- D. Files in /tmp are marked immutable by the kernel until the next reboot clears the directory

**Answer:** A

**Explanation:** /tmp has the sticky bit (shown as t in drwxrwxrwt), which restricts deleting and renaming entries to their owner, the directory owner and root. setuid has no such effect on directories, files in /tmp are not made immutable, and deleting a file depends on permissions of the directory rather than of the file, so alice's umask is not the reason.

### Question 10 of 10

Why should a user protect a new SSH private key with a passphrase when ssh-keygen asks for one?

- A. So that a copied key file cannot be used without also knowing the passphrase
- B. So that the server can verify the key without storing the public key
- C. So that the public key is encrypted before it goes into authorized_keys
- D. So that the key pair never needs to be rotated or replaced afterwards

**Answer:** A

**Explanation:** The passphrase encrypts the private key file, so someone who steals the file still cannot use it without the passphrase. The server still needs the public key in authorized_keys, public keys are not secret and are not encrypted, and protecting a key does not remove the need to rotate it.

Ready for a timed run? Take the free 15-question 010-160 mini exam: https://devopscodelab.com/app/exams/lpi-010-160/mini/

DevOpsCode Lab is not affiliated with LPI. 010-160 and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
