Separate names with a comma.
Discussion in 'Mac Programming' started by SHankara, Dec 12, 2007.
why doesnt osx come with this directory already?Or do you have to sudo mkdir it yourself?
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.
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.
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.
Apple assumes that everyone is as dumb as they are when it comes to UNIX. Or at least the HI people assume it. Whatever.
But then again, I've seen plenty of posts from boasting about how proud they are that they don't know UNIX and don't care for "Terminal"
Anyone ever read this?
What a dunce!
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:
you will see the usr folder listed
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.
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.
No...those are my binaries...go away and get your own...
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
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.
No cd is needed at all. This suffices:
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 / &'.
mkdir -p /usr/local/bin
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?).
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.
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.
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.
go to teminal and input "open /usr/local/bin
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
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.
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.
type the following in Terminal :
sudo mkdir /usr/local; sudo mkdir /usr/local/bin
Anyway, any half decent installer should create directories when they don't exist.
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.
sudo mkdir /usr/local; sudo mkdir /usr/local/bin
/usr/local should be present already. I would start by checking:
then, if not present.