On Mac OS X, the default $PATH values are:


What are the default values on Linux?


On a default Ubuntu desktop install $PATH is:

$ echo $PATH

But in a minimal chroot environment created by debootstrap, $PATH only contains:

# echo $PATH

There are path builtin the shells which is

echo $PATH

Then the default path for Ubuntu is:

echo $PATH

Environment path values are stored in .bashrc file in ubuntu.

The system-wide PATH variable is defined in /etc/environment


There's an easy way to find out:


Or, more directly:

echo $PATH

But, if you're just looking for some quick info, Ubuntu typically sets the path to:


For questions like this, you can usually dig up the answer by reading the Bible.


Depending on which Linux your using, it might be different. If you have a login to a linux already, just type 'env' to see your environment variables.

If you want to know how the PATH env variable is getting built, have a look at .bashrc and .bash_profile in your home directory. If more curious, you can also look at /etc/profile, /etc/profile.d/* (if exists) and manual for bash (man bash).


bash will set PATH to a hard-coded default value if it's not set in the environment:

$ env -i bash -c 'echo $PATH'

We can check that this value is indeed hard-coded, and not read from the environment or some file, using the strings utility:

$ strings /bin/bash | grep /usr/sbin

However, I get a different result on my Arch Linux machine:

$ env -i bash -c 'echo $PATH'

So, it looks like this default is chosen at the time the bash binary was built, which depends on the Linux distribution in use.

  • This is the only answer that mentions the shell, and distributions. I stumbled upon the question because I'm sorting out PATH issues in ubuntu containers. And the "default path" will depend on the shell (bash, sh, etc.) and whether it's loaded interactively or not, and whether it's a login shell. It's not a simple answer. Kudos for mention of the hardcoded strings in the binary. – init_js Apr 9 '19 at 22:31

To see the default path use what other mentioned in answers:

echo $PATH

To edit use:

gedit ~/.bashrc

This default PATH variable are defined under /etc/enviroment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.