Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Sep 21 '10 at 8:18

This question came from our site for professional and enthusiast programmers.

This question is more suited to – Daniel Haley Sep 20 '10 at 16:53
up vote 4 down vote accepted

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
share|improve this answer

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
share|improve this answer

you can just type the full path to sudo:

/usr/bin/sudo vim /etc/bashrc
share|improve this answer
@subhransu: If you did actually edit your system-wide bashrc, I suggest you revert those edits and edit your personal ~/.bashrc instead. – Matti Virkkunen Sep 20 '10 at 16:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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