"which" examines the command-search-path, and returns the location of the command which would be executed.
The which command first checks to see if the specified command is internal to the nShell application. Each directory in the search path is then examined to see if it contains an external command or shell script of the given name. Any 'TEXT' file with a matching name is assumed to be a shell script.