Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 4
    ~/.profile is to configure your login session, not your shell. Only the login shell reads that file. bash customisation goes in ~/.bashrc Commented Nov 14, 2017 at 21:53
  • 1
    @StéphaneChazelas Sorry, Mac user here. Thanks for the comment. I updated my solution. Is that better? Commented Nov 14, 2017 at 22:12
  • I saved it in .bashrc. Had to reopen a terminal to load that config. Now it works, thanks to both very much Commented Nov 14, 2017 at 22:19
  • 1
    @HrvojeT If you have the time and the inclination, you might want to create a temporary user and populate all of their shell initialization and profile files with echo statements, and then open shell windows in various ways, e.g. launch your terminal application, open a new tab, open a new window, run a command in a subshell, etc. That way you can watch and see the order in which the different files are loaded. I remember finding that very instructive. Commented Nov 14, 2017 at 22:21
  • 1
    @Arrow Hmmm. I don't see anything there that says that ~/bin has been designated for user scripts, except by recent versions of Ubuntu. Commented Nov 15, 2017 at 6:14