Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Console Foundations Environment and Redirection Environment Variables

Charles Strawn
Charles Strawn
3,462 Points

PATH environment variables

Hello.

I have run into an issue with the console tool. It seems since this lesson I can't run any commands without exporting several PATH environment variables. This happens every time I start a new console session. So far, Treehouse support has not been able to resolve this issue.

Is there any way to permanently fix this issue? Every time I try to run a command, I get the following error: The command could not be located because '/usr/bin', '/bin', '/usr/sbin', etc. is not included in the PATH environment variable.

Thanks, Charles

1 Answer

Absolutely. Depending on which shell you use (sh, bash, zsh, etc) there will be a corresponding "dot file" which you can set things like your PATH variable in. It gets loaded each time you open a new terminal. For bash you want to add lines to ~/.bashrc for zsh it will be ~/.zshrc. For example:

  export PATH=".:${HOME}/bin:/usr/bin:/bin"

There are many many other things you can do in these profiles as well but for just getting your PATH set that should be all you need.

Charles Strawn
Charles Strawn
3,462 Points

Thanks Geoff!

Looks like the issue is resolved.

Glad you got your issue resolved.

Be warned though, once you start tinkering with your "dot files" you'll get addicted. Next thing you know you'll be tweaking your prompt and setting aliases for common tasks. :)