Where Is the Command?

Linux uses your PATH variable to find a command that you enter on the command-line.
:.:

So, if the shell searches until it finds the command, how can you tell where it is?

In other words, if you have 2 files, both are executable, and both are named mycmd, how can you tell which is being executed?

There are a number of commands that will tell you this, based on your system. Which ones work on your flavor of Linux?

You may have more than one - note the differences.