2

I have been reading an article from GeeksforGeeks that includes the following image of a unix filesystem layout:

enter image description here

After some reading (mainly of this post) I was able to determine the difference between /bin and /usr/bin. But, I haven't found anything detailing what /home/<username>/bin is used for. What binaries are stored here? Is it packages that a user might have downloaded from the web, or something similar?

peachykeen
  • 149
  • 3
  • 7
  • 3
    The /home/<username>/bin directory isn't part of the Filesystem Hierarchy Standard. It also isn't, as far as I'm aware, a standard directory in use by any of the major Linux distributions. If you see a directory there, then it's likely that a user of your system created it - either a system administrator, or you yourself. Can you explain what's motivating you to ask about this directory? – igal Mar 21 '19 at 22:18
  • Thank you for your response @igal. I have seen it referenced in a few places like the article I shared above. But, it didn't really make sense to me why there would be this directory in the first place instead of just using some other bin directory. Also, when I looked at my unix machine's filesystem, I didn't see the folder so I was a bit curious. Thanks for sharing the hierarchy standard. I haven't seen that wiki article. :) – peachykeen Mar 21 '19 at 22:23
  • I didn't see it referenced in the article. I did a text search and didn't see that it was included in the graphic. The most common reason for having a bin directory in your home directory would be if you don't have administrative privileges on the system in question - in which case you can't install software in the other bin directories. – igal Mar 21 '19 at 22:26
  • @igal it isn't referenced in the article, but in the filesystem hierarchy image I linked above which made it confusing. – peachykeen Mar 21 '19 at 22:28

2 Answers2

3

What's stored in your home directory are things that

  1. Got copied there when the account was created, probably from some place like /etc/skel.
  2. Things you yourself created, such as text files, scripts etc. that you have written.
  3. Things other programs created or stored on your behalf, such as mail, cache files, configuration files etc.

The way you organise your $HOME is largely up to you (some applications may expect to find certain files in particular locations). For example, you may want to put executable scripts that you create (or programs that you compile) under $HOME/bin and then add that directory to your $PATH, but you may just as well have a $HOME/exe or $HOME/runnables directory that serves the same purpose. Or several of them, if that makes more sense to you.

There is no standard that dictate the organisation of the user-created files under $HOME.

Kusalananda
  • 333,661
0

The binaries which could be placed there would be for a particular user purposes only. But with current standards, this is deprecated and discouraged.

As you could see from the File Hierarchy Standard from the Linux Foundation website, the concept of /home is host-dependent and even considered as optional:

/home is a fairly standard concept, but it is clearly a site-specific filesystem. The setup will differ from host to host. Therefore, no program should assume any specific location for a home directory, rather it should query for it.

However, having /home/username/bin/ is something you can encounter on RPM-based distributions, such as Fedora, Red Hat Entreprise Linux or Suse. On this aspect, they are not considered fully FHS-compliant if binaries are placed in $HOME/bin directory which should be placed in standardized folders.

Paradox
  • 1,425