Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between ~/bin vs /usr/local/bin on mac

I have a few exec scripts that I want to run on my command line.

Which folder should I place them in ~/bin or /usr/local/bin?

What is the difference between both of these folders?

Which is the be used when?

like image 817
murtaza52 Avatar asked Feb 10 '26 18:02

murtaza52


1 Answers

Use ~/bin (or some similar location inside your home directory) if you want the scripts to be available only to your user account (not other user accounts, including root). Essentially, this'd be your personal bin folder where you can do whatever you want without disturbing other users. You'll also have to add this to your PATH (in ~/.bash_profile, ~/.profile, or whatever).

If you want the scripts to be available under all user accounts OR don't have any other user accounts OR just don't care, use /usr/local/bin instead. This'll save the hassle of editing your PATH, and is generally a more standard location.

like image 143
Gordon Davisson Avatar answered Feb 12 '26 15:02

Gordon Davisson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!