- Home
- Server Administration
- LPIC-1 Linux Administrator 101
76.
You’ve installed a commercial spreadsheet program called WonderCalc on a workstation.
In which of the following directories are you most likely to find the program executable
file?
- A./usr/sbin
- B./etc/X11
- C./boot
- D./opt/wcalc/bin
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
The /opt directory tree exists to hold programs that aren’t a standard part of a Linux distribution, such as commercial programs. These programs should install in their own directories under /opt; these directories usually have bin subdirectories of their own, although this isn’t required. Thus, option D is correct (that is, it’s a plausible possibility). The /usr/sbin directory holds programs that are normally run only by the system administrator, so it’s not a likely location, making option A incorrect. The /etc/X11 directory holds X-related configuration files, so it’s very unlikely that WonderCalc will be housed there, making option B incorrect. The /boot directory holds critical system boot files, so option C is incorrect. The /sbin directory, like /usr/sbin, is an unlikely location for user files, so option E is incorrect. (Furthermore, /sbin seldom contains subdirectories.) |
77.
Which of the following file-location commands is likely to take the most time to find a file
that may be located anywhere on the computer (assuming the operation succeeds)?
- A.The find command.
- B.The locate command.
- C.The whereis command.
- D.The type command.
- E.They’re all equal in speed.
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
The find utility (option A) operates by searching all files in a directory tree, and so it’s likely to take a long time to search all of a computer’s directories. The locate program uses a precompiled database, whereis searches a limited set of directories, and type searches the shell’s path and built-in commands, so these commands will take less time. Thus, options B, C, D, and E are all incorrect. |
78.
What can the type command do that whereis can’t do?
- A.Identify the command as being for x86 or x86-64 CPUs
- B.Locate commands based on their intended purpose, not just by name
- C.Identify a command as an alias, internal command, or external command
- D.Identify a command as being a binary or a script
- Answer & Explanation
- Report
Answer : [C]
Explanation :
Explanation :
The type command identifies a command, as executed by the shell, as being a built-in shell command, a shell alias, or an external command, whereas the whereis command helps find the location of external command files. Thus, option C is correct. Neither type nor whereis identifies the CPU architecture of a program file, can locate commands based on intended purpose, complete an incompletely typed command, or identify a command as a binary or a script; thus, the remaining options are all incorrect. |
79.
You want to track down all the files in /home that are owned by karen. Which of the following
commands will do the job?
- A.find /home -uid karen
- B.find /home -user karen
- C.locate /home -username karen
- D.locate /home Karen
- E.find /home -name karen
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :
The find command includes the ability to search by username using the -user name option, where name is the username; thus, option B is correct. The -uid option to find can also locate files owned by a user, but it takes a numeric user ID (UID) number as an argument, so option A isn’t quite correct. The locate command provides no ability to search by user, so options C and D are incorrect. Although option E is a valid find command, it finds all the files under /home with a filename of karen, not all files owned by the user karen, so this option is incorrect. |
80.
What can you conclude from the following interaction?
$ which man
/usr/bin/man
$ which man
/usr/bin/man
- A.The only file called man on the computer is in /usr/bin.
- B.The /usr/bin/man program was installed by system package tools.
- C.The /usr/bin/man program will be run by any user who types man.
- D.The first instance of the man program, in path search order, is in /usr/bin.
- E.The user man owns the /usr/bin/man program file.
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
The which program searches the path just as bash does, but it prints the path to the first executable program it finds on the path. Thus, option D is correct. The which program doesn’t conduct an exhaustive search of the system, so there could be many more files called man on the system, contrary to option A. System package tools and which aren’t closely related; option B is incorrect. Although /usr/bin/man would be run when the user whose which output matches that in the question types man, this may not be true of others because the path can vary from one user to another. Thus, option C is incorrect. The which program doesn’t reveal file ownership information, so option E is incorrect. |