1

I had edited the bashrc file wrongly in my Ubuntu, while trying to put an "export" command in bashrc for javac.

When I type sudo, it's saying:

Command 'sudo' is available in '/usr/bin/sudo' The command could not be located because '/usr/bin' is not included in the PATH environment >variable. sudo: command not found

How should I correct this?

1

3 Answers 3

4

Restore your .bashrc with the following command:

cp /etc/skel/.bashrc ~

If you want to see the differences between your customized .bashrc and the default one, use this (no changes are made):

diff /etc/skel/.bashrc ~/.bashrc
1

You likely stomped on your existing PATH variable. Make sure that if you export PATH, include the existing PATH, too:

export PATH=$PATH:/whatever/you/added
0

you can just type the full path to sudo:

/usr/bin/sudo vim /etc/bashrc
1
  • @subhransu: If you did actually edit your system-wide bashrc, I suggest you revert those edits and edit your personal ~/.bashrc instead. Sep 20, 2010 at 16:57

You must log in to answer this question.

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