Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 010-160 Exam - Topic 3 Question 69 Discussion

Posted by Francine on Jun 28, 2026 at 01:42 PM

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

Suggested Answer: D

The correct command to search for the file foo.txt under the directory /home is find /home --name foo.txt. This command uses the find command, which is used to search for files and directories that match certain criteria. The first argument, /home, specifies the starting point of the search. The second argument, -name, indicates that the search is based on the name of the file or directory. The third argument, foo.txt, is the name of the file to be searched for. The find command will recursively search all the subdirectories under /home and print the path of any file or directory that matches the name foo.txt.

The other commands are incorrect for various reasons:

A . search /home --file foo.txt is incorrect because there is no such command as search in Linux. The correct command for searching files and directories is find.

B . search /home foo.txt is incorrect because, as mentioned above, there is no search command in Linux. Also, this command does not use any option to specify the search criteria, such as -name, -type, -size, etc.

C . find /home -- file foo.txt is incorrect because the option -file is not valid. The correct option for specifying the type of file or directory is -type, followed by a letter that indicates the type, such as f for regular file, d for directory, l for symbolic link, etc. For example, find /home -type f -name foo.txt would search for a regular file named foo.txt under /home.

E . find /home foo.txt is incorrect because this command does not use any option to specify the search criteria, such as -name, -type, -size, etc. This command will search for any file or directory that has foo.txt as part of its name, not exactly as its name. For example, this command will also match a file named barfoo.txt or a directory named foo.txt.bak.


Get Premium 010-160 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
25 comments · newest first
GA
Gabriele 10 days ago
Right! D is the best choice here.
FR
Francine 15 days ago
C has an extra space. That’s a no-go for me.
AF
Afton 20 days ago
I like D too. It’s straightforward and effective.
LA
Lashawnda 25 days ago
E seems too vague. It might not search properly.
CA
Candra 1 month ago
Yeah, A doesn't look right. D is definitely better.
AL
Alease 1 month ago
I feel like A is misleading. The command format is off.
LU
Luisa 1 month ago
Agreed! D is clear and specific.
KR
Kris 2 months ago
I think D is the right answer. It uses the correct syntax.
LA
Lashon 2 months ago
Definitely D. It’s the standard way to find files in Linux.
EI
Eileen 2 months ago
I like D too! It’s the best option for searching files.
ED
Eden 2 months ago
I’m leaning towards D as well. It’s straightforward.
MA
Mari 2 months ago
E is too vague. It doesn't specify the name option.
MA
Magda 2 months ago
C looks wrong too. The extra space before "file" is a mistake.
IV
Ivette 3 months ago
I feel like A is confusing. The syntax seems off.
VE
Vernell 3 months ago
Agreed! D is clear and specific.
GR
Graciela 3 months ago
I think D is the right choice. It uses the correct syntax.
TH
Theodora 3 months ago
Definitely D, can’t go wrong with that one!
RE
Refugia 3 months ago
I’m surprised that B is even listed, it seems off.
JA
Jacki 3 months ago
Wait, why is A even an option? That looks wrong.
LA
Lavonna 4 months ago
I think E might work too, but not as precise.
CO
Cortney 4 months ago
D is the correct command!
LE
Letha 4 months ago
I practiced a similar question where we had to use "find" with specific flags, so I lean towards option D being the right choice.
CH
Charlette 4 months ago
I feel like option E could be correct too, but I can't recall if it needs any flags like "--name" to work properly.
FA
Fabiola 4 months ago
I'm not entirely sure, but I remember something about using "--name" to specify the file name in the command.
MA
Mariann 4 months ago
I think the command should start with "find" since that's what we used in practice for searching files.
0/2000 characters

Save Cancel