Quantcast
Channel: Planet Ubuntu
Viewing all articles
Browse latest Browse all 17727

Brandon Holtsclaw: Quick Tip

$
0
0

If you are anything like me and spend quite a bit of time on a Unixy CLI like Ubuntu or OS X, the you might find this of some use.

I tend to have a lot of programs and scripts I write or compile outside the package management of the OS so /usr/local/bin and ~/,bin tend to get quite crowded on my machines. Here is a little snip that you can add to your ~/.bashrc or as I like to do add it system wide to my /etc/profile that will allow you to easily put those scripts and programs in subdirectories of /usr/local/bin or ~/.bin and still magically be in your path.

PATH="~/.bin:$(find ~/.bin -type d -d 1|tr "\n" ":" |sed 's#:$##'):/usr/local/bin:$(find /usr/local/bin -type d -d 1|tr "\n" ":" |sed 's#:$##'):/usr/local/sbin:"$PATH
export PATH

Add that, close your terminal and reopen it ( or source the file ) and then "echo $PATH" in the new terminal to make sure everything looks as you'd expect.

My Bash-foo isn't the best so additions/corrections/suggestions and flames welcome , also this has only been tested on one of my OSX and Ubuntu machines, so use with caution, I cant see it doing permeant damage in any way but ya never know, it may eat kittahs for breakfast, you've been warned.


Viewing all articles
Browse latest Browse all 17727

Trending Articles