[help] I tampered with .bashrc file, How to restore it

421 views
Skip to first unread message

Abhinandan Kothari

unread,
Aug 27, 2010, 8:37:07 PM8/27/10
to iit...@googlegroups.com
i was configuring java on my ubuntu and by mistake i saved wrong path and now its giving error if i am typing ny command in terminal  ls, sudo , cp , mv anything.

--------------------------------------------------------------------------------------------
abhi@abhi-laptop:~$ ls
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
-------------------------------------------------------------------------------------------------

this problem is only for user named abhi that is local user  , root does not have ny problem
actually i have wrongly edited ~/.bashrc file for user named abhi
plz help me out , how to restore the file
--
Abhinandan Kothari

NAGAMOHAN YENUGANTI

unread,
Aug 28, 2010, 12:03:20 AM8/28/10
to iit...@googlegroups.com

The path variable is corrupted. The commands are not getting executed because the path of binaries is not available. 
The commands may be executed by giving absolute path like /bin/ls
The path variable should be like this.

export PATH= /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:$PATH

--
Thanking You
Y.NagaMohan
Integrated Electronics & Circuits ( 2007-09 )
M.Tech, IIT Delhi
+918050786558

Sudarsan Sridhar

unread,
Aug 31, 2010, 5:15:10 AM8/31/10
to iit...@googlegroups.com
Log in to the root user and the  ~abhi/.bashrc

Just change:
export $PATH=$JAVA_HOME/bin
to
export $PATH=$JAVA_HOME/bin:$PATH

Also, what guide are you following? Installing java in ubuntu is as simple as 
apt-get install sun-java6-jdk

All configurations including path are done automatically.

Regards,
Sudarsan

Abhinandan Kothari

unread,
Sep 3, 2010, 1:56:22 AM9/3/10
to iit...@googlegroups.com
Thanks a lot.
--
Abhinandan Kothari
Reply all
Reply to author
Forward
0 new messages