PATH question (newbie)

ZIYAD A. M. AL-BATLY zamb at spymac.com
Sun Apr 17 21:39:52 UTC 2005


On Sun, 2005-04-17 at 11:44 -0400, Matthew S-H wrote:
> OK, another one of my stupid questions, lolz.
Never stupid for just asking/learning!  You have to do more than that on
this list to be called "stupid".

> How do I change my PATH to include everything in /opt/ ?
> 
> 
> ~Matt
(WARNING: I'm not sure I did understand your question, so be careful
with my advice below!)

What do you mean by everything in /opt?

If all you want is to make any executable files in /opt in the PATH then
put:
        PATH="$PATH:/opt"
        export PATH
at the end of "~/.bashrc" and "~/.bash_profile".

However, if you meant to include the files that are inside the
directories in /opt then put:
        PATH="$PATH:$(find /opt -type d -maxdepth 0 | tr ' ' ':')"
        export PATH
at the end of "~/.bashrc" and "~/.bash_profile" (make sure that you
don't have any directories with spaces in their names inside /opt! For
example: "/opt/gnome 1.4.0" will not work).

Ziyad.





More information about the ubuntu-users mailing list