I know that when you are on shell, the only commands that can be used are the ones that can be found on some directory set on PATH. Even I don\'t know how to see what dirs a
PATH is an environment variable, and can be displayed with the echo command:
echo $PATH
It's a list of paths separated by the colon character ':'
The which command tells you which file gets executed when you run a command:
which lshw
sometimes what you get is a path to a symlink; if you want to trace that link to where the actual executable lives, you can use readlink and feed it the output of which:
readlink -f $(which lshw)
The -f parameter instructs readlink to keep following the symlink recursively.
Here's an example from my machine:
$ which firefox
/usr/bin/firefox
$ readlink -f $(which firefox)
/usr/lib/firefox-3.6.3/firefox.sh