{"id":220,"date":"2011-02-25T12:33:35","date_gmt":"2011-02-25T11:33:35","guid":{"rendered":"http:\/\/daniel.hepper.net\/blog\/?p=220"},"modified":"2013-04-18T13:30:32","modified_gmt":"2013-04-18T12:30:32","slug":"change-order-of-path-entries-on-mac-os-x","status":"publish","type":"post","link":"https:\/\/daniel.hepper.net\/blog\/2011\/02\/change-order-of-path-entries-on-mac-os-x\/","title":{"rendered":"Change order of PATH entries on Mac OS X"},"content":{"rendered":"<p>I wanted to have <code>\/usr\/local\/bin<\/code> to be listed before <code>\/usr\/bin<\/code> in my <code>PATH<\/code> environment variable.<\/p>\n<p>One way to achieve this would be to add a <code>~\/.profile<\/code> file with a line like this:<\/p>\n<p><code>export PATH=\/usr\/local\/bin:$PATH<\/code><\/p>\n<p>This would result in <code>\/usr\/local\/bin<\/code> being listed twice. It wouldn&#8217;t hurt but it&#8217;s not pretty either.<\/p>\n<p>If you look at <code>\/etc\/profile<\/code>, you will see that the initial value of <code>PATH<\/code> is set by <a href=\"http:\/\/developer.apple.com\/library\/mac\/#documentation\/Darwin\/Reference\/ManPages\/man8\/path_helper.8.html\"><code>path_helper(8)<\/code><\/a>.<\/p>\n<p>The right way to change the order of default paths is to edit <code>\/etc\/paths<\/code>. It contains one path per line, in descending order. Mine looks like this:<\/p>\n<p><code>\/usr\/local\/bin<br \/>\n\/usr\/bin<br \/>\n\/bin<br \/>\n\/usr\/sbin<br \/>\n\/sbin<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to have \/usr\/local\/bin to be listed before \/usr\/bin in my PATH environment variable. One way to achieve this would be to add a ~\/.profile file with a line like this: export PATH=\/usr\/local\/bin:$PATH This would result in \/usr\/local\/bin being &hellip; <a href=\"https:\/\/daniel.hepper.net\/blog\/2011\/02\/change-order-of-path-entries-on-mac-os-x\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[32,11],"tags":[],"class_list":["post-220","post","type-post","status-publish","format-standard","hentry","category-apple-2","category-howto"],"_links":{"self":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/comments?post=220"}],"version-history":[{"count":5,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/220\/revisions"}],"predecessor-version":[{"id":467,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/220\/revisions\/467"}],"wp:attachment":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/media?parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/categories?post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/tags?post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}