I just got a MacBook Pro and am in the process of trying to get GNU commands installed. I'm following this guide, but I don't know how to do:

Then add the following line to your .bashrc or .zshrc:

export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"

I did a cd; ls -a and I don't see any files called .bashrc or .zshrc.

Additional Info:
Running Yosemite 10.10.3 on a MacBook Pro. Already have Xcode installed. Total newbie at this.


2 Answers 2


To know which shell are you using, use the following command:

$ echo $SHELL

It will return something like:




After you know the shell, if the file .bashrc or .zshrc doesn't exist in your home directory (echo $HOME to find out), just create it.

If you are using bash, you may have a file called .bash_profile where you can put your export command instead (don't know in zsh).

  • Mine returns to /bin/bash, but I don't have a .bashrc. How and where do I create it? I do remember seeing a .bash_profile somewhere after doing 'ls -a' but I don't remember how I got there
    – Tommy K
    Apr 20, 2015 at 20:30
  • 3
    @TommyK create it in your user dir, using touch ~/.bashrc
    – njboot
    May 13, 2015 at 7:39
  • vscode adds something to the PATH, but I didn't see the file .zshrc, so which file did it modify?
    – Raining
    Apr 16, 2020 at 7:07

Create your .bashrc with your text editor & add any files you want. Go to terminal and type in: ls -a It will show some hidden files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .