Which of the following tools can show the complete path of an executable file that the current shell would execute when starting a command without specifying its complete path? (Choose two.)
Which of the following tools can show the complete path of an executable file that the current shell would execute when starting a command without specifying its complete path? (Choose two.)
To determine the complete path of an executable file that the current shell would execute when starting a command without specifying its complete path, two effective tools are 'which' and 'type'. The 'which' command searches the PATH for executable files and returns the full path to the command. Similarly, the 'type' command can also be used to display information about shell commands, including showing the full path of executables. Therefore, these two tools successfully fulfill the requirements specified in the question.
CE is correct
C and D. E is incorrect
then justify your claim.
C and E is correct. locate would also show other Files and excecutables outside the $PATH directories. So it does not match the requirements of the question.
which and locate
In situations where the question asks for tools that show the exact executable used by the shell, which and type are more appropriate answers because they consider the shell's environment and $PATH. So, while locate could technically find executables, which and type are still the better choices in this case.
Also locate command can show the full path of a executable, but if it says two all right, the other options are more correct.
yes, but locate needs the updatedb.
+ mlocate as it's not builtin hehe
+ mlocate as it's not builtin hehe
locate command will show every possible items that contained *command* It has default file globbing that needs regex control during searching.
C&E not D
CE, you will be able to check the executable by type -a