If you open your .profile
file, located in your home directory, i.e. /home/yourusername
or ~
, using sudo gedit ~/.profile
, it actually says, which files are used by your login shell.
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
PATH=/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
(Typing echo $PATH
in your terminal would have also given you the value of the PATH
variable.)
I neither have a .bash_profile
nor a .bash_login
file, therefore the command interpreter of my login shell - which is bash - executes my .profile
as stated in the file. (Find out what your shell is by using echo $SHELL
. Should the output be different from /bin/bash
, you may be interested in in this: https://unix.stackexchange.com/questions/88201/whats-the-best-distro-shell-agnostic-way-to-set-environment-variables)
Even though it says in the .profile
file above include .bashrc if running bash
, my .bashrc
file is empty, for example.
Therefore I included the paths to the directories of my commands like /usr/bin
directly in the .profile
file.
If /usr/bin
is not included in the value of your PATH
variable, defined in your .profile
file, just add it after the other paths using a colon. The order of paths does not matter.
Part of the reason why this happened to you after booting into your other OS is because changes like permanently deleting or adding a path take only effect after reboot. So, as @solsTiCe already mentioned, Windows cannot mess with your system. "Something" else must have changed the PATH
variable.
path paths .profile login loop 14.04
grep PATH ~/.bashrc
in a terminal window and see if the/usr/bin
is in the line. – Terrance May 20 '15 at 18:10