Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Sep 21 '10 at 8:18

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

1  
This question is more suited to superuser.com –  Daniel Haley Sep 20 '10 at 16:53
add comment

3 Answers

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.