September 2017
Intermediate to advanced
466 pages
9h 33m
English
The which(1) utility searches the value of the PATH environment variable in order to find out if an executable file can be found in one of the directories of the PATH variable. The following output shows the way the which(1) utility works:
$ echo $PATH /home/mtsouk/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games $ which ls /home/mtsouk/bin/ls code$ which -a ls /home/mtsouk/bin/ls /bin/ls
Our implementation of the Unix utility will support the two command-line options supported by the macOS version of which(1), which are -a and -s with the help of the flag package: the Linux version of which(1) does not support the -s option. The -a option lists all the instances of the executable instead ...
Read now
Unlock full access