0

Possible Duplicate:
Can a Bash script tell what directory it's stored in?

Is there a command-line function (bash) to find the location of the command you've executed?

I understand I could check my $PATH for things I've imported manually but there must be some way to do this. A tricky echo command or something?

Community
  • 1
  • 1
Kristian
  • 1,351
  • 1
  • 14
  • 20

1 Answers1

1

Besides whereis, see also which and type.

choroba
  • 231,213
  • 25
  • 204
  • 289
  • `type` has the advantage of being a shell builtin, so it can tell you whether something is actually a builtin, alias or function, rather than an external command. – Neil Feb 06 '12 at 23:35
  • I liked type the most of all these. thanks! – Kristian Feb 07 '12 at 00:58