re: Is there a good explainer for bash profiles and paths? VIEW POST

re: Lots of resources online if you want to go deeper on those, but here are some basics. PATH is where your shell looks to find commands to run. You ...

Bear in mind that multi-element environment variables are processed left-to-right. Which is to say, if you have, say, three commands (shared-libraries, man pages, etc.) that share a common name, the one that appears left-most in the relevant environment-variable is the one that will get invoked. Get familiar with tools like which, ldd, locate and the like. They can help you figure out why things are acting unexpectedly when you invoke a given binary or link to a given library or try to read a given man-page/infodoc/etc.

As to the various profiles... There's rules to how early and in what order they're read and under what circumstances they're read. And, you'll become acutely aware of these rules when you're pulling your hair out wondering "why does this work from my SSH session but doesn't work from a cron-job or a systemd unit??"

code of conduct - report abuse