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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s