how to remove PATH variable?
If I want to add search path to PATH variable I type
export PATH=$PATH:~/bin (for example) So how can I remove this path? |
You could reset the PATH variable.
export PATH=/bin:/usr/bin This would just be for that session. For all user sessions edit the ~/.bashrc of the user or /etc/profile for the machine |
Typing
echo $PATH Will show you what your full current path is. Then, you can retype the whole thing without the parts you don't want, like this; export PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11 If you want to get fancy and automatic, you can use the sed program to remove the last entry automagically. export PATH=`echo $PATH | sed 's/:[^:]*$//'` Just copy and paste that to a terminal. Remember, everything you export is forgotten when you log out anyway, unless you put the command in your ~/.bashrc file. -Andrew |
All times are GMT -5. The time now is 07:40 AM. |