~ / bin is in PATH

why the commands located in ~ / bin can be run from anywhere?

That's not necessarily true. However, many login scripts add ~/bin in the path.

You can see the path with:
env | egrep "\bPATH="
Last edited on
it maybe I asked the question in incorrect way,

I mean If ~ / bin is in PATH it means that commands located in ~ / bin can be run from anywhere.
From man bash:
Environment variable PATH
The search path for commands. It is a colon-separated list of directories in which the shell looks for commands

Command execution
If the [command] name is neither a shell function nor a builtin, and contains no slashes, bash searches each element of the PATH for a directory containing an executable file by that name.
Registered users can post here. Sign in or register to post.