Which of the following commands displays the path to the executable file that would be executed when the command foo is invoked?
Which of the following commands displays the path to the executable file that would be executed when the command foo is invoked?
The command 'which foo' displays the path to the executable file that would be executed when the command 'foo' is invoked. 'which' is specifically used to locate the executable file associated with a given command by searching through the directories listed in the PATH environment variable.
A. lsattr foo -- lsattr: No such file or directory while trying to stat ls B. apropos foo - all man pages - apropos - search the manual page names and descriptions C. locate foo - locate file via updatedb refernce D. whatis foo - whatis - display one-line manual page descriptions E. which foo - show location lib -which - locate a command
E which: A command that searches for the executable file associated with the given command in the directories listed in the PATH environment variable. foo: The command for which you want to determine the executable file's path.
Answer: E