I'm following this guide to install Linux commands onto my OS Terminal: https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/ and I see that the second line tells me to add a line to my .bashrc file, which I have to create since I don't have one. Can anyone explain to me what this does? As well as the PATH
command in general?
MacOS – What does adding PATH to .bashrc do
bashhomebrewmacosterminal
Related Question
- MacOS – Workflow/tools for installing command line application on OS X (Yosemite or later)
- MacOS – How to change the GNU Make’s (default) default location of gcc
- MacOS – Adding smb printer through terminal
- GNU Locate – gupdatedb Fails with gfind Error
- Adding Environment Variables
- Homebrew Git – Unable to Install Git Using Homebrew
Best Answer
When you run a command in
bash
(or any other Unix shell), the shell searches for this command in a number of directories. The list of directories is stored in the variable calledPATH
, paths are separated by:
.The command in question extends the already defined
$PATH
by two additional paths:/usr/local/bin
which is the usual place user-provided commands get installed to$(brew --prefix coreutils)/libexec/gnubin
which points to some utility commands required by brewTo see the current value of
PATH
, runecho $PATH
in Terminal.