Guest elr008 Posted April 1, 2010 Report Share Posted April 1, 2010 Basically, I modified my bashrc file without backing it up first, and, after I modified it, none of my commands like ls will do anything. I added the following code to the startup file (~/.bashrc): PATH=/usr/local/jdk1.6.0/bin: export PATH I just typed in this code at the end of the file, saved it, and logged out and back in. When I logged back in, no commands like ls or man will work anymore.. Does anyone know a solution to this? Thanks Quote Link to comment Share on other sites More sharing options...
pindakoe Posted April 1, 2010 Report Share Posted April 1, 2010 You have reducedthe path (list of places BASH looks for the program you want to start) to the Java DK only. The default PATH is /bin:/usr/bin:/usr/local/bin:/usr/games: (the ':' is used as separator). Mandriva sets defaults like this via a whole bunch of files. Following should in your .bashrc to get htis fixed (but I am not 100% that this actually covers the PATH variable): if [ -f /etc/bashrc ]; then . /etc/bashrc fi Other files that are relevant are /etc/bashrc obviously and /etc/profile Quote Link to comment Share on other sites More sharing options...
jkerr82508 Posted April 1, 2010 Report Share Posted April 1, 2010 (edited) To add a directory to the path, try something like: PATH=$PATH:/usr/local/jdk1.6.0/bin export PATH Jim Edited April 1, 2010 by jkerr82508 Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted May 5, 2010 Report Share Posted May 5, 2010 (edited) This may be a solution (it will erase any line in your file with the “PATH†sentence in it): /bin/sed -i /PATH/d ~/.bashrc Or you may try and cure the problem instead, by adding the “normal†path after your own: /bin/sed -ri 's#^PATH=(.*[^[:blank:]]):*[[:blank:]]*$#PATH=\1:$PATH#' ~/.bashrc Yves. Edited May 5, 2010 by theYinYeti Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.