I will assume you installed it through
As you said, your
PATH is modified by
What the shell does is very simple, it looks at your command and splits it with the spaces and look for the first word (in you case,
Then it looks at the
PATH environment variable (see its value with
echo $PATH) which contains different directories separated by semicolons (
:). It splits it with the semicolons and then iterate through every directory to see if there is a file that you have the rights to execute. When it finds it, the shell executes it giving the rest of the words as arguments.
In the case of
rvm, you should have
/home/username/.rvm/rubies/ruby-1.9.3-p374@global/bin in you
PATH. It should find an executable called
rake which then executes an executable called
/home/username/.rvm/gems/ruby-1.9.3-p374@global/gems/rake-10.0.3/bin which run
/home/username/.rvm/gems/ruby-1.9.3-p374@global/gems/rake-10.0.3/lib/rake.rb (your version may vary).