I recently started to put all my dotfiles in a VCS, and just for complete organization, I thought of creating a personal "usr" folder, as in a folder within the home folder that gets "merged" with the usr directory whenever looking up commands in PATH or even man pages. Now for the questions:

  1. Is there any reason I shouldn't be doing this? Are there any downsides I'm not seeing, or better alternatives?
  2. If there aren't any downsides, how could this be achieved?

I already know of this question, but from what I understand the top answer suggests an option that would actually put files in /usr, while I would prefer a method similar to adding a folder to PATH, it doesn't actually move any files it just looks for them in different places.

I also looked into overlayfs, but it looks like it runs on boot. While it might be faster, I would prefer that my files are merged when I login.


Do once:

mkdir -p usr/bin usr/man

Add to your ~/.profile or other shell initialization file:


... and then put things into those directories.


  • The PATHs are searched from left to right. If you have developed a program called robot, the order may not matter much.  If you have developed a program called cat, and you want to run it instead of /bin/cat, then you will need to put ~/usr/bin ahead of /bin in $PATH; e.g., by


    Note that this can represent a security risk.  If you do this, and an attacker can get write access to your home directory, he can leave a Trojan Horse in your ~/usr/bin directory and take over your account.

  • If you want to get fancy, you can look at the current value of $PATH and put ~/usr/bin somewhere in the middle.  This may be harder to maintain.
  • While there's nothing serious wrong with the above, you might prefer to use ~/bin instead of ~/usr/bin.  In fact, depending on what system you have, you just might find that ~/bin (a.k.a. $HOME/bin) is already in $PATH by default.
  • 1
    On some operating systems, such as Ubuntu for example, the shipped shell profiles will already do that in fact, with $HOME/bin. – JdeBP Jul 21 '17 at 6:55
  • @JdeBP: Good point; I added it to the answer. – Scott Jul 21 '17 at 7:02
  • There are also a few distros that have this kind of concept inherent in the package manager (on NixOS for example, packages can be installed into profiles, and users can create, switch, and manage their own profiles at will). – Austin Hemmelgarn Jul 21 '17 at 11:54
  • The man part was only one example, not all programs allow the path to be changed. A preferred solution would be to somehow merge the two folders without the need to modify any paths. – JoshyRobot Jul 21 '17 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.