Linux Essentials (010-160) — Question 6

Which of the following commands will search for the file foo.txt under the directory /home?

Answer options

Correct answer: D

Explanation

The correct command is D, 'find /home -name foo.txt', which accurately searches for a file by its name within the specified directory. Options A and C are incorrect due to the misuse of the command 'search' and incorrect syntax. Option B has a space in 'foo. txt', which would make it invalid, while option E lacks the '-name' flag, which is essential for a name-based search.