In 2009, Massachusetts became the first state to adopt an above-code appendix to the 'base' building energy code-the 'Stretch Code'. The Stretch Code, which emphasizes energy performance, as opposed to prescriptive requirements, is designed to result in cost-effective construction that is more energy efficient than that built to the 'base' energy code.
This particular problem got me struggled for a while. The first app Iinstalled and wasn’t aware of all my binaries wasEmacs.
For some reason it was aware of everything in /usr/bin
but not/usr/local/bin
. For quite a while I thought it was something relatedto Emacs.
Then I installed Qute Browser and onceagain, some binaries available on my system were not in the path whensearched from within Qute.
I did some research but didn’t find anything useful. At some point Ifigured out that if I was starting the GUI app (whether it was Emacs,Qute Browser, MacVim, …) from the terminal, everything was ok. All thebinaries on my system could be found.
It got me curious. Why such a different behavior when I launched theapp by clicking its icon in the Applications folder or byusing Spotlight compared to when I launched it using my term?
Oh boy, this one was a very long road to the true knowledge, the realmastering of Mac OS internals!
The first step to this full understanding was asking myself why my GUIapps would know about the PATH
environment variable I set in myshell? It could be set in ~.profile
, ~/.bashrc
, ~/.bash_profile
,~/.zsh_profile
, ~/.zshrc
, ~/.config/fish/config.fish
, you namedit.
It doesn’t makes any sense unless if you start the app from the shellknowing the full blown PATH
.
Being confident thanks to this discover I investigated to understandwhere the GUI apps got their paths from and after some deep diving Igot the answer.
Every single app that is started by clicking its icon or throughspotlight gets its PATH
from whatever is set by launchd
daemon.
Now we know this crucial info there’s one simple step left tocustomize the PATH
GUI apps inherit from. It’s as simple as editing/etc/launchd.conf
like so:
Now rather than scanning for binaries only in /usr/bin
and/usr/sbin
, GUI apps are going to search for binaries in all thesepaths: /usr/local/bin
/usr/local/sbin
/usr/bin
/bin
/usr/sbin
/sbin
.
If you want your changes to be effective without having to reboot yourcomputer – I hate rebooting my computer – you’ll have to follow somemore steps.
This steps will help launchd
and Spotlight to be aware of the newsettings:
This one greps all environment related settings and forward them tolaunchd
.
Then you have to restart your Dock
and Spotlight
apps:
Now every GUI app you launch inherits of this PATH env variable, eitheryou launch it by clicking the icon in Applications folder or usingSpotlight!
Enjoy!
Mac OS X doesn’t have an obvious way to view the exact text based path to a folder (otherwise known as a directory) in the finder window. You can have it show a graphical path, but getting just the text based path to a directory (for use in the Terminal for example) requires a couple of extra steps.
Apple removed the ability to easily copy the file path in OS X Yosemite. Yosemite users must now follow a complicated procedure of creating a Service to do this simple task or take the path directly from the command line.
If you are a El Capitan user you are in luck, Apple has now created a specific command to capture the file path. Instructions on how to use this can be found here.
Here are the instructions for finding the file path on Mavericks and below...
The first thing to do is identify the folder you need to know the full path for. In this example it’s the “month 1″ folder of my Insanity Workout folder (and yes, I did buy Insanity, directly from Amazon actually and these are my back-ups. It’s not pirated like so much Beachbody stuff unfortunately is!):
Now we can simply press the “cmd+i” keys together to open up the “Get Info” window. This displays various bits of info about the folder as you can see below:
You can see that the Get Info window contains the line “Where:” followed by the text folder path. This is the path to the folder we have been looking for. The path to the folder is highlighted and made clearer in the screenshot below:
You can now copy this text based absolute folder path and paste it into your Terminal window. NOTE – If the directory path contains spaces, as the example i have used in this post does, you MUST use ” quotation ” marks around the path when typing it into the Terminal. The screenshot below demonstrates this:
Knowing the text based absolute path to a folder can be useful for a number of reasons. Being able to locate the precise path allows you to unlock the full power of the Terminal, which can often be faster and more efficient that using the Graphical User Interface.
Mac OS X doesn’t have an obvious way to view the exact text based path to a folder (otherwise known as a directory) in the finder window. You can have it show a graphical path, but getting just the text based path to a directory (for use in the Terminal for example) requires a couple of extra steps.
Apple removed the ability to easily copy the file path in OS X Yosemite. Yosemite users must now follow a complicated procedure of creating a Service to do this simple task or take the path directly from the command line.
If you are a El Capitan user you are in luck, Apple has now created a specific command to capture the file path. Instructions on how to use this can be found at teh link below:
Here are the instructions for finding the file path on Mavericks and below...
The first thing to do is identify the folder you need to know the full path for. In this example it’s the “month 1″ folder of my Insanity Workout folder (and yes, I did buy Insanity, directly from Amazon actually and these are my back-ups. It’s not pirated like so much Beachbody stuff unfortunately is!):
Now we can simply press the “cmd+i” keys together to open up the “Get Info” window. This displays various bits of info about the folder as you can see below:
You can see that the Get Info window contains the line “Where:” followed by the text folder path. This is the path to the folder we have been looking for. The path to the folder is highlighted and made clearer in the screenshot below:
You can now copy this text based absolute folder path and paste it into your Terminal window. NOTE – If the directory path contains spaces, as the example i have used in this post does, you MUST use ” quotation ” marks around the path when typing it into the Terminal. The screenshot below demonstrates this:
Knowing the text based absolute path to a folder can be useful for a number of reasons. Being able to locate the precise path allows you to unlock the full power of the Terminal, which can often be faster and more efficient that using the Graphical User Interface.