Feb 18, 2012

Linux Filesystem Hierarchy Standard


Linux distributions use the FHS: http://www.pathname.com/fhs/pub/fhs-2.3.html http://ru.wikipedia.org/wiki/FHS

You can also try man hier.

I'll try to sum up answers your questions off the top of my head, but I strongly suggest that you read through the FHS:
  • /bin is for non-superuser system binaries
  • /sbin is for superuser (root) system binaries
  • /usr/bin & /usr/sbin are for non-critical shared non-superuser or superuser binaries, respectively
  • /mnt is for temporarily mounting a partition
  • /media is for mounting many removable media at once
  • /dev contains your system device files; it's a long story :)
  • The /usr folder, and its subfolders, can be shared with other systems, so that they will have access to the same programs/files installed in one place. Since /usr is typically on a separate filesystem, it doesn't contain binaries that are necessary to bring the system online.
  • /root is separate because it may be necessary to bring the system online without mounting other directories which may be on separate partitions/hard drives/servers
  • Yes, /etc stands for "et cetera". Configuration files for the local system are stored there.
  • /opt is a place where you can install programs that you download/compile. That way you can keep them separate from the rest of the system, with all of the files in one place.
  • /proc contains information about the kernel and running processes
  • /var contains variable size files like logs, mail, webpages, etc.
To access a system, you generally don't need /var, /opt, /usr, /home; some of potentially largest directories on a system.
One of my favorites, which some people don't use, is /srv. It's for data that is being hosted via services like http/ftp/samba. I've see /var used for this a lot, which isn't really its purpose.

No comments: