Linux Directory Structure for non-root users

directorylinux

I am new to the world of Linux and am about to make a complete transition from Windows to Linux so I can really get into it. I understand that Linux has a hierarchical structure however am unclear about the following;

  • Currently for example I have 2 partitions on my Windows machine i.e. C:\ and D:. C:\ is the boot partition but also the partition where all software is installed e.g. Office, Firefox, etc. D:\ is used to store data such as documents, images, etc. Essentially D:\ store any data of value. Now if my understanding is right in Linux the usr directory would store all my applications. My home directory stores all my data files. Is that correct?
  • Assuming if that is correct and I am logged in as a non-root user, I take it I can install software that does not require root permissions. If so, can I choose a directory other than usr to install the software?
  • Can I create directories outside of home as a non-root user or am I restricted to just the home directory? I know this depends on the permissions of the user however if I am looking at a user created in a vanilla installation of Linux how would this differ?
  • What other directories are used by non-root users?
  • Assuming I have Apache installed on the PC, does this mean a non-root user would have to be given permissions to access, update and delete to the var/www. This is a workstation that will be used by several people.

Best Answer

  1. Mostly. Read the FHS for the full story.

  2. Distro packages usually require root permission to be installed. Software installed from source or that comes with its own installer can usually be installed in a user's home directory.

  3. It all depends on ownership and permissions, but not of the user per se.

  4. /tmp, as well as anything that has had its ownership and permissions appropriately set.

  5. No. See 3 and 4 above.

Related Topic