Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
uh oh..
just found out that the commands other than clustalw will not work again..
ls, cd and all.
Then i did a
export PATH=$PATH:/bin:
ls, cd and some commands worked.
But not whereis, rmmod, cluster-fork.
Anymore suggestions?
These paths are going to drive me crazy..
I think you may need to take a step back and spend a few minutes looking at a larger picture so you don't get lost in details.
Think for a moment about what your $PATH is. I may say some things here that are obvious, but it may help.
$PATH is a variable which lists a string of directories that applications search for executable files. Using these directories allows you and your scripts to call applications without the need for an exact path to these commands. It's kinda like saying "I'm going to Sam's house"...you don't need to say "I'm going to Sam's house at 15 Rogers Street, Chicago, Illinois" because the path to his house is already known.
There are a few files which set what directories are in $PATH. /etc/profile and/or /etc/bashrc set a global $PATH, and $HOME/.bashrc sets the $PATH for individual users.
With $HOME/.bashrc you can either append directories to the global $PATH or you can completely replace it with your own $PATH. If you want to append, you must include "$PATH" in the value of your new $PATH: PATH=$PATH:~/bin:/opt/firebird:~/scripts
If you do not include the original $PATH, your new path will consist of only the directories listed in $HOME/.bashrc, and the global $PATH will be ignored.
The global $PATH is usually already set with the essential system binary directories such as /bin and /usr/bin. If you find that a lot of standard commands don't work anymore, chances are you either removed the paths from the global $PATH or you replaced the global $PATH completely (failed to include "$PATH" in your local $PATH).
First thing I'd do is check the global settings, located in /etc/profile or perhaps a bash configuation file such as /etc/bashrc or /etc/bash.bashrc. This should show you all the standards:
/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin...if all of these (and perhaps a few more) are not set in /etc/profile, you're likely to have trouble.
What I like to do is LEAVE GLOBAL FILES ALONE as much as possible, and use only local configuration files whenever I can. Setting a $PATH locally to me means appending only...I leave the $PATH in /etc/profile as it is and add directories to it in $HOME/.bashrc, as mentioned above.
As an added note, your $PATH may be altered by other scripts beyond /etc/profile and $HOME/.bashrc. It's possible that you have afaulty script somewhere that completely replaces $PATH instead of appending to it.
Thanks milkshaw.
My echo $PATH show
/opt/BioBrew/ClustalW/1.8.3/bin:/usr/local/sbin:/opt/BioBrew/ClustalW/1.8.3/bin:/usr/local/sbin:/opt/BioBrew/ClustalW/1.8.3/bin:/bin::/usr/X11R6/bin:/opt/ganglia/bin:/opt/maui/bin:/
And a lot of repeated paths..
When i tried to source /etc/profile:
bash: id: commad not found
[: =: unary operator expeeted
bash: id: command not found
bash: dircolors: command not found.
But in my /etc/profile i only have:
export PATH=/opt/BioBrew/ClustalW/1.8.3/bin:/usr/local/sbin:/sbin:$PATH
Where did the extra lines come from?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.