Exam 101-500 Topic 3 Question 274 Discussion
Actual exam question for Lpi's 101-500 exam
Question #: 274
Topic #: 3
Question #: 274
Topic #: 3
Which of the following commands can be used to search for the executable file foo when it has been placed in a directory not included in $PATH?
Suggested Answer: C Vote an answer
Explanation
The correct command to search for the executable file foo when it has been placed in a directory not included in $PATH is find. The find command can search for files and directories based on various criteria, such as name, type, size, permissions, ownership, and more. To find the executable file foo, you can use the following command:
find / -type f -executable -name foo
This command will search the entire filesystem (/) for regular files (-type f) that are executable (-executable) and have the name foo (-name foo). The other commands are not suitable for this task. The apropos command searches the manual page names and descriptions for a keyword. The which command shows the full path of a command that is in the $PATH variable. The query command is not a standard Linux command. The whereis command locates the binary, source, and manual page files for a command, but only in the standard Linux directories. References:
* [LPI Linux Essentials - 1.1 The Linux Community and a Career in Open Source]
* [LPI Linux Essentials - 1.2 Finding Your Way on a Linux System]
* [LPI Linux Essentials - 1.3 Basic File Management]
* [LPI Linux Essentials - 1.4 Finding Files]
* [LPI Linux Essentials - 2.1 Using Devices, Linux Filesystems, Filesystem Hierarchy Standard]
* [LPI Linux Essentials - 2.2 Mounting, Unmounting Filesystems]
* [LPI Linux Essentials - 2.3 Disk Partitions]
* How to Use the find Command in Linux - How-To Geek
* Find Command in Linux (Find Files and Directories) | Linuxize
* find command in Linux with examples - GeeksforGeeks
* Use the Unix find command to search for files
The correct command to search for the executable file foo when it has been placed in a directory not included in $PATH is find. The find command can search for files and directories based on various criteria, such as name, type, size, permissions, ownership, and more. To find the executable file foo, you can use the following command:
find / -type f -executable -name foo
This command will search the entire filesystem (/) for regular files (-type f) that are executable (-executable) and have the name foo (-name foo). The other commands are not suitable for this task. The apropos command searches the manual page names and descriptions for a keyword. The which command shows the full path of a command that is in the $PATH variable. The query command is not a standard Linux command. The whereis command locates the binary, source, and manual page files for a command, but only in the standard Linux directories. References:
* [LPI Linux Essentials - 1.1 The Linux Community and a Career in Open Source]
* [LPI Linux Essentials - 1.2 Finding Your Way on a Linux System]
* [LPI Linux Essentials - 1.3 Basic File Management]
* [LPI Linux Essentials - 1.4 Finding Files]
* [LPI Linux Essentials - 2.1 Using Devices, Linux Filesystems, Filesystem Hierarchy Standard]
* [LPI Linux Essentials - 2.2 Mounting, Unmounting Filesystems]
* [LPI Linux Essentials - 2.3 Disk Partitions]
* How to Use the find Command in Linux - How-To Geek
* Find Command in Linux (Find Files and Directories) | Linuxize
* find command in Linux with examples - GeeksforGeeks
* Use the Unix find command to search for files
by Janet at Jul 14, 2026, 07:18 PM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).