Every command fails with "command not found" after changing .bash_profile?

Solution 1:

It looks to me that at one point or another you are overwriting the default PATH environment variable. The type of errors you have, indicates that PATH does not contain /bin, where the above commands (including bash) reside.

For example, if you do

PATH=/home/user/bin

instead of

PATH="$PATH":/home/user/bin

Solution 2:

One way to begin debugging your bash script would be to start a subshell with the -x option:

$ bash --login -x

This will show you every command, and its arguments, which is executed when starting that shell.

The --login option is specified because .bash_profile is read by login shells. Further information on debugging bash scripts can be found here: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html.

Ultimately, I think that January's suggestion will work for you, but that link is worth a read for future problems.