Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SHankara

macrumors member
Original poster
Oct 5, 2007
98
0
why doesnt osx come with this directory already?Or do you have to sudo mkdir it yourself?
 

samh004

macrumors 68020
Mar 1, 2004
2,222
141
Australia
I would imagine it'd be hidden so idiots can't screw things up (not implying you). You could try pressing Command + G and then typing the path exactly as you typed here, that might get you there...

Or you could go into Terminal and show hidden files and folders.
 

SHankara

macrumors member
Original poster
Oct 5, 2007
98
0
no its not there,I was wondering why it wouldnt already be there for anybody who wants their own binaries installed there
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
The Land of Hope and Glory
no its not there,I was wondering why it wouldnt already be there for anybody who wants their own binaries installed there

Because 99.9% of Mac users wouldn't have a clue what you were talking about if you mentioned /usr/local/bin. Apple have probably just decided that those who do know about it also know how to create the directories themselves. Seems reasonable to me.
 

ScKaSx

macrumors regular
Feb 27, 2006
105
0
I noticed that too, when I first got my MacBook 10.4.9. I was also surprised because it is quite common in the unix world!

Anyways, you can create it yourself like I did (yes, sudo mkdir /usr/local/bin will work). Or if you use FINK (or darwin ports) some of the programs you install will automatically generate that folder.

Cheers,
ScKaSx
 

rbot1980

macrumors newbie
Feb 3, 2009
2
0
I am new to using terminal but..

i think you will find your usr/local/bin folder if you drop back a few directories

When I load up terminal it starts me in my user folder (Users/MacPro/) if you:

cd ../../
ls

you will see the usr folder listed
 

crackpip

macrumors regular
Jul 23, 2002
210
0
It is my understanding that /usr/local is meant to hold things that an administrator installs on a system, separate from what's included in a vanilla install. Perhaps Apple follows this convention literally. By definition, if you haven't installed any binaries or libraries, you have a vanilla install and thus wouldn't have anything in /usr/local.

crackpip
 

GroovyLinuxGuy

macrumors regular
Apr 2, 2006
139
0
Canada
It is my understanding that /usr/local is meant to hold things that an administrator installs on a system, separate from what's included in a vanilla install. Perhaps Apple follows this convention literally. By definition, if you haven't installed any binaries or libraries, you have a vanilla install and thus wouldn't have anything in /usr/local.

crackpip


I just create /usr/local/bin as soon as I do an install, but most of my scripts live in bin in my home directory. If you make it, OS X will include it in its $PATH automatically (at least I don't remember adding it to $PATH).
 

crackpip

macrumors regular
Jul 23, 2002
210
0
I just create /usr/local/bin as soon as I do an install, but most of my scripts live in bin in my home directory. If you make it, OS X will include it in its $PATH automatically (at least I don't remember adding it to $PATH).

Nothing wrong with that unless you have a bunch of other users using your binaries.

On a couple of my machines I have to use special versions of the kerberos binaries, and kerberized versions of openSSH. I stick those in /usr/local/bin so that I don't overwrite the default versions in case it would screw with OS X. But, they are still easily available to other users.

crackpip
 

GroovyLinuxGuy

macrumors regular
Apr 2, 2006
139
0
Canada
Nothing wrong with that unless you have a bunch of other users using your binaries.

crackpip

No...those are my binaries...go away and get your own... :D

True enough, I was thinking on more of a single user system, I don't know why, but that was the impression that I got from the original post. Just to add, I usually create an /opt directory as well to put bigger packages in and symlink them back to /usr/local/bin for convenience
 

webfoot

macrumors newbie
Jul 20, 2011
2
0
Hi,

I actually know nothing about this (I am a graphic designer), however my "Computer Savvy" 9 1/2 year old son would like to offer the following suggestions:

"Hi, To go into the usr/local/bin directory open Terminal then type (In 1 line)
"cd ../..; cd usr; open ." Then hit enter. It will open a new finder window that is directly inside the usr folder. Then you can double click on local then bin to go into usr/local/bin. Just to tell you guys the usr folder is invisible and is only visible in Terminal. I hope this helps! I bet you are surprised about how young I am. From, Justin"

Hi this is Justin again,

To go to the opt folder: Open a new Terminal window type (In 1 line)
"cd ../..; cd opt; open ."
This will also open a new finder window that will have the opt folder opened without you having to make it.
 
Last edited by a moderator:

Hansr

macrumors 6502a
Apr 1, 2007
897
1
Hi,

I actually know nothing about this (I am a graphic designer), however my "Computer Savvy" 9 1/2 year old son would like to offer the following suggestions:

"Hi, To go into the usr/local/bin directory open Terminal then type (In 1 line)
"cd ../..; cd usr; open ." Then hit enter. It will open a new finder window that is directly inside the usr folder. Then you can double click on local then bin to go into usr/local/bin. Just to tell you guys the usr folder is invisible and is only visible in Terminal. I hope this helps! I bet you are surprised about how young I am. From, Justin"

Hi this is Justin again,

To go to the opt folder: Open a new Terminal window type (In 1 line)
"cd ../..; cd opt; open ."
This will also open a new finder window that will have the opt folder opened without you having to make it.

cd ../.. is not needed cd /usr or /opt is simpler. Open . will not create a folder it will just open a new Finder window in the current folder. /usr/local/bin should be created manually because will MacOSX doesn't ship with any user specific binaries, ergo create it once needed.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,747
8,419
A sea of green
cd ../.. is not needed cd /usr or /opt is simpler. Open . will not create a folder it will just open a new Finder window in the current folder. /usr/local/bin should be created manually because will MacOSX doesn't ship with any user specific binaries, ergo create it once needed.

No cd is needed at all. This suffices:
Code:
open /usr

Also:
Code:
mkdir -p /usr/local/bin
It creates intermediate directories as needed. So if /usr/local doesn't exist, it creates it. If it does exist, it uses the existing one.



And when I was 9 1/2 I was into things made from old clock mainsprings (several types of GI Joe crossbow come to mind), chemistry, lenses, and ants. These might not be something you'd mention to an actual 9 1/2-year-old, though I'm not sure which is more dangerous: those things or 'rm -fR / &'.
 
Last edited:

webfoot

macrumors newbie
Jul 20, 2011
2
0
cd ../.. is not needed cd /usr or /opt is simpler. Open . will not create a folder it will just open a new Finder window in the current folder. /usr/local/bin should be created manually because will MacOSX doesn't ship with any user specific binaries, ergo create it once needed.

But it is already created for you.
Why would you create it if it is already there?
"cd /usr" and "cd /opt" is definitely simpler but "cd../..; cd usr; open ." and "cd ../..; cd opt; open ." was the first thing I thought of.
Also, if you want the finder window with that folder showing, just add ";open .".
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
But it is already created for you.
Why would you create it if it is already there?
"cd /usr" and "cd /opt" is definitely simpler but "cd../..; cd usr; open ." and "cd ../..; cd opt; open ." was the first thing I thought of.
Also, if you want the finder window with that folder showing, just add ";open .".

The OP wanted to know about /usr/local/bin, not /usr/opt/bin. /usr/local/bin is standard on Linux (other Unix's as well?).
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
There's no such thing as a Linux standard. :) It's not standard UNIX since OS X conforms to the UNIX specification. There is a /usr/local which is for executables and and libraries not included by the basic OS.
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
There's no such thing as a Linux standard. :)

I was about to counter with a quote from the Linux Filesystem Hierarchy Standard, but discovered it's not the Linux FHS but just the FHS. Unless your were being pedantic (rightly so?) about Linux the kernel verses Linux distros.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
My point was that someone could put together a Linux system without a /usr/local/bin and it would still be a Linux system, no? It could be anything using the Linux kernel, how many Linux distros are there? Just a couple of thousands or so. :) Don't worry though, I'm not being completely serious, it's just that Linux always struck me as kind of wild and uncontrolled.
 

foidulus

macrumors 6502a
Jan 15, 2007
904
1
There's no such thing as a Linux standard. :) It's not standard UNIX since OS X conforms to the UNIX specification. There is a /usr/local which is for executables and and libraries not included by the basic OS.

Well I guess now we are getting into semantics, yes its not part of the unix standard, but it a unix convention. We were using /usr/local/bin on Irix machines in the late 80s/early 90s before Linux even existed :p
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Well I guess now we are getting into semantics, yes its not part of the unix standard, but it a unix convention. We were using /usr/local/bin on Irix machines in the late 80s/early 90s before Linux even existed :p

Agreed, but it's a convention on OS X as well even though apparently that directory is not created by default on a clean OS install. :D
 

kamickrn

macrumors newbie
Feb 8, 2012
1
0
I'm having some issues with OS X Lion and the usr/local/bin folder. Essentially it's not there and I keep getting permission denied errors when I try to create it in terminal. When I try to create it in a finder window it says the name is already taken. BUT, when I use the Go function and type in usr/local/bin it says the directory doesn't exist! This is very frustrating and makes no sense at all to my non-programmer brain. My other computer has this directory and it's running Lion....I'm guessing some program I installed must have created the directory for me on my other machine because I certainly did not create it.

I'm trying to install blueutil on both machines and until I get the usr/local/bin folder accessible on this machine the install keeps failing saying the "directory /usr/local/bin does not exit (1) "

If anyone can help I would be greatly appreciative.

Thanks,

Kevin
 

KnightWRX

macrumors Pentium
Jan 28, 2009
15,046
4
Quebec, Canada
type the following in Terminal :

Code:
sudo mkdir /usr/local; sudo mkdir /usr/local/bin

Anyway, any half decent installer should create directories when they don't exist. :confused:

I dunno why people made such a long thread back in 2007 about something so simple. BTW : don't ressurect threads, start your own.

Not to mention this isn't a programming question and does not belong in the programming forum.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
type the following in Terminal :

Code:
sudo mkdir /usr/local; sudo mkdir /usr/local/bin

Anyway, any half decent installer should create directories when they don't exist. :confused:

/usr/local should be present already. I would start by checking:

Code:
ls /usr/local/bin

then, if not present.

Code:
mkdir /usr/local/bin
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.