O'Reilly logo

Korn Shell: Unix and Linux Programming Manual, Third Edition, The by Anatole Olczak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The whence Command

The whence command is used to display information about a command, like if it is an alias, built-in Korn shell command, function, reserved Korn shell word, or just a normal Unix command. The format for the whence command is:

					whence
					name
				

or

					whence –v
					name
				

where name is the command or whatever you want to get information about. Here, the whence command shows that history is set to fc –l:

					$ whence history
					fc —l
				

The –v option causes more information to be provided about the command. Now we see that history is an exported alias:

					$ whence —v history
					history is an exported alias for fc —l
				

and until is a keyword:

					$ whence —v until
					until is a keyword
				

For compatibility with the Bourne shell, a preset alias type is set to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required