2026 LPI Linux Essentials 010-160 Complete Practice Test

Session length

1 / 20

Which command will search for the file foo.txt under the directory /home?

locate foo.txt

find /home -name foo.txt

The command that effectively searches for the file named foo.txt under the directory /home is the one that uses the find utility with the specified directory and file name. When you use find /home -name foo.txt, the system will recursively search through the /home directory and its subdirectories to locate an exact match for the file named foo.txt.

The find command is specifically designed for searching files and directories based on various criteria, such as name, type, size, and more, making it a powerful tool for file search operations within the filesystem. The -name option ensures that the command looks for the exact name provided.

When you need to find a specific file in a directory structure, especially when you don't know the exact location or hierarchy, using the find command combined with the correct parameters is the most reliable method.

search /home foo.txt

grep -r foo.txt /home

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy