I'm just getting started with Terminal, the other day I might have messed something up with my urs/local/bin. When executing echo $PATH it returns me with /usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin the original path was /usr/local/bin How do I set it back to factory settings?

Thanks in Advance for your Help.

  • 1
    The $PATH you now have /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin is the default setting. – Scot May 19 '15 at 3:03

By default the paths are saved in the file /etc/paths. You can edit it e.g. with sudo vim /etc/paths. Each line should contain one directory used for $PATH.

Then there is the directory /etc/paths.d/ that can contain text files with paths in it.

Furthermore the path can be modified in the files ~/.bashrc and ~/.bash_profile.

However, the $PATH you are stating is the default one and usually desired. Restricting it to only /usr/local/bin would make a lot of default applications - like vim, ls, or even sudo that reside in /usr/bin/ or /bin/ - inaccessible without typing their whole paths every time.

You must log in to answer this question.

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