LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unsetting a part of ENV variable (https://www.linuxquestions.org/questions/linux-newbie-8/unsetting-a-part-of-env-variable-223465/)

praveenv 08-28-2004 08:44 AM

unsetting a part of ENV variable
 
Dear friends !

My PATH variable contains so many paths.I want to remove Particular path from it , because I entered it wrong.
exa: PATH:/usr/bin: /usr/sbin/:/root/:etc....,Now I want to remove" /usr/bin" from it

How to do ?

amfoster 08-28-2004 09:05 AM

Your initial path is set in /etc/profile but you can over write it anywhere.

How did you set your extra path directories? In ~/.profile or ~/.bash_profile?

If you want to completely rewrite it just enter
export PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/jre/bin

or whatever you want it to be in your ~/.profile or ~/.bash_profile

praveenv 08-28-2004 09:24 AM

unset
 
I added ay command prompt

$PATH=$PATH:\ALL PATHS

amfoster 08-28-2004 09:36 AM

That shud be good just for this login session. Log out and in again and see if you get the defaults


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