0

I'm new to running ubuntu as a desktop. I've managed a linux (non ubuntu) server for quite a while now. But, I've just been barely getting by. I am scared I'll mess something up and cpanel/whm is my go-to.

I know a little bit (command wise).. but my first question on this community is about the file system.

I've googled, and looked at questions on this forum.. but I can't find any that specifically deal with what I'm asking for. If they exist and this question is a duplicate, I greatly apologize.

My question:

Where do I store things on the file system? Specifically downloaded applications/programs.

I know I can put files anywhere I want but I want to adhere to commonly used practices.

Let me give an example.

I download skype and apache web server. Skype shouldn't be available to every user on the system.. just me. Apache should be a system service available to everyone.

  • Should I install skype to my /home/me/ directory (or a subdirectory of that)
  • Should it be installed in system apps location (where is that? /bin? /usr/bin?)
  • So apache is installed... (in some location). Do each users public html folder go in their /home/username/public directory? or a created /home/username/public_html directory? or does it go where apache is installed
  • Unrelated.. where should I put downloaded media (music, movies, etc)? Can other users access these by default?
  • If I install a program through software center or apt-get, where do they go automatically? Does the package determine this
  • Is there some document available I can read that talks about where ubuntu (or linux in general, i guess) puts stuff? My google attemps lead to explanations of ubuntu filesystem instead of where things go inside of the filesystem. A link would be appreciated.

Please be as specific as possible relating to my numbered questions. Thanks in advance.. I'm loving this so far!

-Scott

1

Should I install skype to my /home/me/ directory (or a subdirectory of that)

You shouldn't install Skype manually. Just download and install the ".deb" package.

Should it be installed in system apps location (where is that? /bin? /usr/bin?)

The apps are stored normally in /usr/bin or /usr/lib http://ubuntuforums.org/archive/index.php/t-818509.html

  • /usr/bin

    This directory contains the vast majority of binaries on your system. Executables in this directory vary widely. For instance vi, gcc,
    gnome-session and mozilla and are all found here.

  • /usr/lib

    This directory contains program libraries. Libraries are collections of frequently used program routines.

So apache is installed... (in some location). Do each users public html folder go in their /home/username/public directory? or a created /home/username/public_html directory? or does it go where apache is installed

It should go where apache is installed (normally the www directory). However, you can follow this guide if you want to achieve something else: http://httpd.apache.org/docs/2.4/howto/public_html.html

Follow this guide if you want to learn more about the "how" and "where" of an apache installation: http://httpd.apache.org/docs/2.4/install.html

  • /usr/local

    The original idea behind '/usr/local' was to have a separate ('local') '/usr' directory on every machine besides '/usr', which might be just mounted read-only from somewhere else. It copies the structure of '/usr'. These days, '/usr/local' is widely regarded as a good place in which to keep self-compiled or third-party programs. The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable amongst a group of hosts, but not found in /usr. Locally installed software must be placed within /usr/local rather than /usr unless it is being installed to replace or upgrade software in /usr.

Unrelated.. where should I put downloaded media (music, movies, etc)? Can other users access these by default?

It's normally in /home/$username/Downloads. Other users can't access these files.

Further information: http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/home.html

/home is a fairly standard concept, but it is clearly a site-specific filesystem. Different people prefer to place user accounts in a variety of places. This section describes only a suggested placement for user home directories; nevertheless we recommend that all FHS-compliant
distributions use this as the default location for home directories.
On small systems, each user's directory is typically one of the many
subdirectories of /home such as /home/smith, /home/torvalds,
/home/operator, etc. On large systems (especially when the /home
directories are shared amongst many hosts using NFS) it is useful
to subdivide user home directories. Subdivision may be accomplished by using subdirectories such as /home/staff, /home/guests, /home/students, etc. The setup will differ from host to host. Therefore, no program should rely on this location.

If you want to find out a user's home directory, you should use the getpwent(3) library function rather than relying on /etc/passwd because user information may be stored remotely using systems such as NIS.

User specific configuration files for applications are stored in the user's home directory in a file that starts with the '.' character
(a "dot file"). If an application needs to create more than one dot
file then they should be placed in a subdirectory with a name starting with a '.' character, (a "dot directory"). In this case the
configuration files should not start with the '.' character.

It is recommended that apart from autosave and lock files programs
should refrain from creating non dot files or directories in a home
directory without user intervention.

From tldp

If I install a program through software center or apt-get, where do they go automatically? Does the package determine this

Yes it does. As already mentioned it should be in /usr/bin or /usr/lib. However, if you are installing applications manually it's often best practice to use /opt. http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html

https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html

Is there some document available I can read that talks about where ubuntu (or linux in general, i guess) puts stuff? My google attemps lead to explanations of ubuntu filesystem instead of where things go inside of the filesystem. A link would be appreciated.

http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/

https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html

https://en.wikibooks.org/wiki/LPI_Linux_Certification/Create_Partitions_And_Filesystems

https://en.wikibooks.org/wiki/LPI_Linux_Certification (in general - LPIC information)

  • Thanks. My first post in the community and received an excellent answer. Thank you. A few followup questions. Why not install skype from command line? I'm trying to do as much possible from CLI to learn. Second, regarding apache.. my server setup has always stored my public html files in /home/username/public_html. If I store them in /var/ww/public_html - how would this account for multiple users to store their public html files? I reckon this is an apache configuration question instead of ubuntu filesystem. And lastly, is /usr/bin for common libraries used by multiple apps.. or any lib? – Scott Jul 29 '15 at 6:58
  • There is a difference between "installing manually" and "from command line" :) You can install it from cli following this guide help.ubuntu.com/community/Skype in chapter "Installing Skype". /usr/bin is commonly used for binaries while /usr/lib is for libraries. For the apache question I would recommend to open up another question on this site. – OddDev Jul 29 '15 at 7:13
  • @Scott You may want to tick the green check mark beneath the voting arrows. You'll mark your question as "answered" doing so. – OddDev Jul 29 '15 at 13:25
0

You should download your data to /home/<your_userid>. I put my downloads to /home/kouros/downloads.

When you want to install a program that does not come from a package, you could put it to /usr/bin. I prefer to put it to /opt/bin, but for that you have to change the path variable (see bash(1) manpage). Then you can change the user, group and permissions of the binary in a manner that only you can execute and read it (see chown(1) and chmod(1) manpages). Another way would be to put the binary to /home/<your_userid>/bin and only change your path variable.

When you install a program that comes with a package, you cannot change anything, else removing the package or applying updates will not work correctly. Then you could secure it using apparmor.

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.