where the heck is /usr/local/bin?, who th…
apple Verified ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I just want to write some perl scripts for some simple operations. This should be more than a little easy on OS, which is based on Unix. I drafted a script in a plain text editor and attempted to save it to an appropriate place on the PATH. The editor couldn't find it (/usr/local/bin). I ls -l's /usr/local - bin exists, but I do not have write permissions there - only "wheel" does. What's with this? /usr/local/bin is meant for loca (i.e. my, rather than system) use. And anyway, why is it invisible. Can't find it with Finder.
6 replies
Sign in or join Beachball Help to reply.
- 0
BobHarris ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I just want to write some perl scripts for some simple operations. This should be more than a little easy on OS, which is based on Unix.
Apple goes to a lot of trouble to hide the Unix complexities from its typical consumer base. One of the things they really want to keep the typical consumer away from are the directories involved in running the operating system.
I drafted a script in a plain text editor and attempted to save it to an appropriate place on the PATH. The editor couldn't find it (/usr/local/bin).
Most GUI editors will not find the Unix specific directories. As someone else has pointed out, they are marked hidden. Again this is so that the typical Apple consumer customer will not mess with them.
There are GUI text editors that will ignore the hidden flag, such as TextWrangler (free download)
<http://www.versiontracker.com/dyn/moreinfo/macosx/18529>I ls -l's /usr/local - bin exists, but I do not have write permissions there - only "wheel" does. What's with this?
Wheel is also know as the "Big Wheel", the "Big Cheese", "Top Banana", etc... On my system /usr/local/bin is owned by root with /usr/local/bin being in the group wheel. However, on my system ONLY root can write into /usr/local/bin.
/usr/local/bin is meant for loca (i.e. my, rather than system) use.
Going back to traditional Unix, where there were lots of users sharing a system, /usr/local/bin was where the local adminstrator would store executables for all local users to use that would not polute the official Unix distribution executables. But, /usr/local/bin still required root privilege before you could write into it, otherwise anyone could mess with those files, and install a malicous program.
The convention was that users would create a $HOME/bin where they would put their personal scripts and programs. They would also add $HOME/bin to the PATH environment variable in their shell initialization file (bash would be .bash_profile).
And anyway, why is it invisible. Can't find it with Finder.
As mentioned earlier Apple does its very best to hide the Unix underside. They are selling an easy to use GUI based operating system, not Unix. Also, throw enough users without Unix experience, and statistically, enough of them will delete essential files in /bin, /sbin, /usr, /etc/, etc... so that they would destroy their system without knowing it, and then Apple would get a phone call. It is easier to hide those files, as most GUI oriented users do not need them, and use the Unix file protections to place another road block between typical users and destruction.
There is an option you can change that will cause the Finder to see all files.
defaults write com.apple.Finder AppleShowAllFiles TRUENow restart the Finder
killall FinderChange TRUE to FALSE and the Finder will stop showing hidden files.
- 0
Mark Jalbert ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Open the Terminal application and type the following->
sudo chflags nohidden /usrWhile you're at it reveal the /private directory->
sudo chflags nohidden /privateNow you will have access to the important "Unix" directories in the Finder. You must be the root user in order to change or put any files in these directories . So, you will have to use the Terminal.
- 0
dankudos ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
As Mark says you can only write to /usr as root so Terminal is the way to go there. You can however browse most of the UNIXy directories using Finders "Go To Folder..."command under the "Go" menu. This may be better than changing the folder to visible as many, many people (who know less than you) have deleted such folders "knowing" that they weren't required by their Macs. Just sayin...
Dan
- 0
etresoft ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
You are not supposed to use the Finder with UNIX level files and directories. That is why they are hidden. Your best bet is to add a user-level "bin" directory to your path and store your personal scripts in there. If you want to use /usr/local/bin, it is best to use the Terminal.
- 0
Carolyn Samit ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
- 0
baltwo ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Carolyn, just a tip. Although the link goes to the appropriate place, the forum's parent is OS X Technologies, not Apple Technologies. 😉