LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   source .bashrc makes command windows fails, how to fix it? (https://www.linuxquestions.org/questions/linux-newbie-8/source-bashrc-makes-command-windows-fails-how-to-fix-it-4175429886/)

googlez 10-01-2012 09:43 AM

source .bashrc makes command windows fails, how to fix it?
 
I use Fedora 17, I add a line to .bashrc: "PATH=/usr/local/opt/intel" .
Then I use #source .bashrc .
I got many error mesage "tty .........".

When I use command #ls to list directory and files.
I got the message: commang not found, similar commands are 'lc' 'lz' .

What can I do to fix this error?

please help, Thanks.

grail 10-01-2012 10:05 AM

The PATH variable is searched when looking to find out what commands a user can use. As you have now set your path to only a single directory, which of course does not house such commands as ls,
they are no longer able to be used.

If your intention is to append this to your path so you have more than the standard locations, you must include the original PATH variable as well.
Something like:
Code:

PATH=$PATH:/usr/local/opt/intel

googlez 10-01-2012 10:34 AM

Quote:

Originally Posted by grail (Post 4794058)
The PATH variable is searched when looking to find out what commands a user can use. As you have now set your path to only a single directory, which of course does not house such commands as ls,
they are no longer able to be used.

If your intention is to append this to your path so you have more than the standard locations, you must include the original PATH variable as well.
Something like:
Code:

PATH=$PATH:/usr/local/opt/intel

But in my .bashrc, there is no other path, I will post it when i come to my office tomorrow.
the only path is what i have added. the problem right now lies in that I can't use almost all commands in command windows, such as: ls, vi, shutdown etc. etc.

grail 10-01-2012 11:57 AM

You misunderstand. PATH is a global variable set by your system administrator. You are able to alter it though via your own personal .bashrc file (hence why it affects only you).


All times are GMT -5. The time now is 04:52 AM.