which [-a] args

commandline session

$ 4.2.36 4 501---> which
$ 4.2.36 5 502---> which -h
Illegal option -h
Usage: /usr/bin/which [-a] args
$ 4.2.36 6 503---> which ls
/bin/ls
$ 4.2.36 7 504---> which -a ls
/bin/ls
$ 4.2.36 8 505---> which -a top
/usr/bin/top
$ 4.2.36 9 506---> which  top
/usr/bin/top
$ 4.2.36 10 507---> echo $?
0
$ 4.2.36 11 508---> which  to
$ 4.2.36 12 509---> echo $?
1
$ 4.2.36 13 510---> which -k top
Illegal option -k
Usage: /usr/bin/which [-a] args
$ 4.2.36 14 511---> echo $?
2
$ 4.2.36 15 512--->


Leave a comment

Your email address will not be published. Required fields are marked *