0

I executed this command from terminal:

export PATH=/home/ravinder/Java_Folder/Important_Programs/Servers/apache-maven-3.2.2/bin

So this is the only directory in my $PATH, I want to restore my path to default.

0

2 Answers 2

2

The default PATH is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games.

If you want to add something to the path, do: export PATH=something:$PATH so the original PATH is retained.

5
  • now i understand, but due to what i executed i have lost my original path, please tell me way to get it back.
    – ravin
    Aug 4, 2014 at 11:52
  • Your default path is in /etc/environment. Just do export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games and you're good to go. Alternatively, reboot.
    – Jos
    Aug 4, 2014 at 12:05
  • reboot didn't do it, it still the path that i set. How can i set the default path permanently. please help me
    – ravin
    Aug 4, 2014 at 12:42
  • Did you perhaps mess up ~/.profile or ~/.bashrc or /etc/environment or /etc/bash.bashrc? What happens if you explicitly put the export command I gave above at the bottom of ~/.profile and reboot?
    – Jos
    Aug 4, 2014 at 12:48
  • when i explicitly put the export command it sets the environment for that particular terminal but in other terminal it doesn't work and same happens on reboot also.
    – ravin
    Aug 4, 2014 at 12:53
1

I opened the ~/.bashrc file in gedit and pasted the following code at the the end of file

export PATH=/home/ravinder/Java_Folder/Important_Programs/Servers/apache-maven-3.2.2/bin:${PATH}

And it worked.

putting it before any other environment variables settings, it didn't work.

Not the answer you're looking for? Browse other questions tagged .