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.


Solution 1:

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

$ echo $SHELL

It will return something like:

/bin/bash

or

/bin/zsh

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).