How to understand the Ubuntu file system layout?












211















In Windows there’re perhaps only a couple of important folders (by important I mean important in my logical picture of the Windows file system) in the installation drive (in my case C:). Namely Program Files and Windows. I simply stay away from Windows folder and the “add remove program files” is good enough to handle the program files folder of Windows. Of course there’s a folder named Users where the users (who are not admins) can access only their folders.



Thus there’s a clear picture at some level in my mind of the Windows file system. In Ubuntu, when I reach the location /, there’s a huge list of folders, most of which I have no clue as to what they contain. The /bin folder seems to be the equivalent of the Windows folder in windows. The /usr folder seems like it’s the equivalent of the Users folder in Windows. But even the /home folder looks like it can fit the bill.



Please understand that I do understand, that Ubuntu (Linux) has a different character than that of Windows, i.e., there need not be exact equivalent of Windows functions, in Ubuntu. All I am looking for is a bit more clearer picture of the Ubuntu file system.



This question is a part of a bigger question which I am splitting up to make it more answerable. The original question can be found here:
http://sgsawant.wordpress.com/2012/05/17/whats-the-equivalent-of-add-or-remove-programs-in-ubuntu/










share|improve this question




















  • 3





    See also the directory-structure tag on Unix & Linux. All Linux distributions follow the same model.

    – Gilles
    May 17 '12 at 18:29











  • Thanks for all your answers. I am a bit confused about a few points: In Windows the setup usually provides through a prompt an option to install a software for all users. How to make that distinction in Ubuntu? Also, this is a usual problem in configuring development softwares to their IDEs. In windows, for example, in "program filesmiktexbin" there's the file "pdflatex.exe". Thus I can point the IDE to this file and configure it. How to go about this process in Ubuntu? Where's the general binary file associated with a software (esp. from the configuration point of view)?

    – Shashank Sawant
    May 17 '12 at 19:02








  • 2





    In Ubuntu, you normally install software for all users. Everything you do through the package manager is for all users. I don't understand the rest of your comment; one does not “configure” the “binary file associated with a software”. You should ask this as a separate question, and give a better explanation of what you're trying to do.

    – Gilles
    May 17 '12 at 19:05











  • Got it. I will frame a new question. Even then here's a short explanation of what I meant: In windows, the .exe files can be easily located. For example: "C:Python27python.exe". So I know where the program Python starts from. Now if I have to use the Eclipse IDE, I can simply point it to python.exe, and this is what I meant by "configure". I configured the IDE for Python. In Ubuntu where's the location where the program is installed? That is what still evades me.

    – Shashank Sawant
    May 17 '12 at 19:10








  • 2





    @Gilles Be careful when saying all. The GoboLinux project actually uses a more Windows like directory structure.

    – new123456
    May 18 '12 at 1:28
















211















In Windows there’re perhaps only a couple of important folders (by important I mean important in my logical picture of the Windows file system) in the installation drive (in my case C:). Namely Program Files and Windows. I simply stay away from Windows folder and the “add remove program files” is good enough to handle the program files folder of Windows. Of course there’s a folder named Users where the users (who are not admins) can access only their folders.



Thus there’s a clear picture at some level in my mind of the Windows file system. In Ubuntu, when I reach the location /, there’s a huge list of folders, most of which I have no clue as to what they contain. The /bin folder seems to be the equivalent of the Windows folder in windows. The /usr folder seems like it’s the equivalent of the Users folder in Windows. But even the /home folder looks like it can fit the bill.



Please understand that I do understand, that Ubuntu (Linux) has a different character than that of Windows, i.e., there need not be exact equivalent of Windows functions, in Ubuntu. All I am looking for is a bit more clearer picture of the Ubuntu file system.



This question is a part of a bigger question which I am splitting up to make it more answerable. The original question can be found here:
http://sgsawant.wordpress.com/2012/05/17/whats-the-equivalent-of-add-or-remove-programs-in-ubuntu/










share|improve this question




















  • 3





    See also the directory-structure tag on Unix & Linux. All Linux distributions follow the same model.

    – Gilles
    May 17 '12 at 18:29











  • Thanks for all your answers. I am a bit confused about a few points: In Windows the setup usually provides through a prompt an option to install a software for all users. How to make that distinction in Ubuntu? Also, this is a usual problem in configuring development softwares to their IDEs. In windows, for example, in "program filesmiktexbin" there's the file "pdflatex.exe". Thus I can point the IDE to this file and configure it. How to go about this process in Ubuntu? Where's the general binary file associated with a software (esp. from the configuration point of view)?

    – Shashank Sawant
    May 17 '12 at 19:02








  • 2





    In Ubuntu, you normally install software for all users. Everything you do through the package manager is for all users. I don't understand the rest of your comment; one does not “configure” the “binary file associated with a software”. You should ask this as a separate question, and give a better explanation of what you're trying to do.

    – Gilles
    May 17 '12 at 19:05











  • Got it. I will frame a new question. Even then here's a short explanation of what I meant: In windows, the .exe files can be easily located. For example: "C:Python27python.exe". So I know where the program Python starts from. Now if I have to use the Eclipse IDE, I can simply point it to python.exe, and this is what I meant by "configure". I configured the IDE for Python. In Ubuntu where's the location where the program is installed? That is what still evades me.

    – Shashank Sawant
    May 17 '12 at 19:10








  • 2





    @Gilles Be careful when saying all. The GoboLinux project actually uses a more Windows like directory structure.

    – new123456
    May 18 '12 at 1:28














211












211








211


175






In Windows there’re perhaps only a couple of important folders (by important I mean important in my logical picture of the Windows file system) in the installation drive (in my case C:). Namely Program Files and Windows. I simply stay away from Windows folder and the “add remove program files” is good enough to handle the program files folder of Windows. Of course there’s a folder named Users where the users (who are not admins) can access only their folders.



Thus there’s a clear picture at some level in my mind of the Windows file system. In Ubuntu, when I reach the location /, there’s a huge list of folders, most of which I have no clue as to what they contain. The /bin folder seems to be the equivalent of the Windows folder in windows. The /usr folder seems like it’s the equivalent of the Users folder in Windows. But even the /home folder looks like it can fit the bill.



Please understand that I do understand, that Ubuntu (Linux) has a different character than that of Windows, i.e., there need not be exact equivalent of Windows functions, in Ubuntu. All I am looking for is a bit more clearer picture of the Ubuntu file system.



This question is a part of a bigger question which I am splitting up to make it more answerable. The original question can be found here:
http://sgsawant.wordpress.com/2012/05/17/whats-the-equivalent-of-add-or-remove-programs-in-ubuntu/










share|improve this question
















In Windows there’re perhaps only a couple of important folders (by important I mean important in my logical picture of the Windows file system) in the installation drive (in my case C:). Namely Program Files and Windows. I simply stay away from Windows folder and the “add remove program files” is good enough to handle the program files folder of Windows. Of course there’s a folder named Users where the users (who are not admins) can access only their folders.



Thus there’s a clear picture at some level in my mind of the Windows file system. In Ubuntu, when I reach the location /, there’s a huge list of folders, most of which I have no clue as to what they contain. The /bin folder seems to be the equivalent of the Windows folder in windows. The /usr folder seems like it’s the equivalent of the Users folder in Windows. But even the /home folder looks like it can fit the bill.



Please understand that I do understand, that Ubuntu (Linux) has a different character than that of Windows, i.e., there need not be exact equivalent of Windows functions, in Ubuntu. All I am looking for is a bit more clearer picture of the Ubuntu file system.



This question is a part of a bigger question which I am splitting up to make it more answerable. The original question can be found here:
http://sgsawant.wordpress.com/2012/05/17/whats-the-equivalent-of-add-or-remove-programs-in-ubuntu/







filesystem






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 29 '14 at 1:08









Braiam

51.9k20136221




51.9k20136221










asked May 17 '12 at 18:12









Shashank SawantShashank Sawant

1,25151216




1,25151216








  • 3





    See also the directory-structure tag on Unix & Linux. All Linux distributions follow the same model.

    – Gilles
    May 17 '12 at 18:29











  • Thanks for all your answers. I am a bit confused about a few points: In Windows the setup usually provides through a prompt an option to install a software for all users. How to make that distinction in Ubuntu? Also, this is a usual problem in configuring development softwares to their IDEs. In windows, for example, in "program filesmiktexbin" there's the file "pdflatex.exe". Thus I can point the IDE to this file and configure it. How to go about this process in Ubuntu? Where's the general binary file associated with a software (esp. from the configuration point of view)?

    – Shashank Sawant
    May 17 '12 at 19:02








  • 2





    In Ubuntu, you normally install software for all users. Everything you do through the package manager is for all users. I don't understand the rest of your comment; one does not “configure” the “binary file associated with a software”. You should ask this as a separate question, and give a better explanation of what you're trying to do.

    – Gilles
    May 17 '12 at 19:05











  • Got it. I will frame a new question. Even then here's a short explanation of what I meant: In windows, the .exe files can be easily located. For example: "C:Python27python.exe". So I know where the program Python starts from. Now if I have to use the Eclipse IDE, I can simply point it to python.exe, and this is what I meant by "configure". I configured the IDE for Python. In Ubuntu where's the location where the program is installed? That is what still evades me.

    – Shashank Sawant
    May 17 '12 at 19:10








  • 2





    @Gilles Be careful when saying all. The GoboLinux project actually uses a more Windows like directory structure.

    – new123456
    May 18 '12 at 1:28














  • 3





    See also the directory-structure tag on Unix & Linux. All Linux distributions follow the same model.

    – Gilles
    May 17 '12 at 18:29











  • Thanks for all your answers. I am a bit confused about a few points: In Windows the setup usually provides through a prompt an option to install a software for all users. How to make that distinction in Ubuntu? Also, this is a usual problem in configuring development softwares to their IDEs. In windows, for example, in "program filesmiktexbin" there's the file "pdflatex.exe". Thus I can point the IDE to this file and configure it. How to go about this process in Ubuntu? Where's the general binary file associated with a software (esp. from the configuration point of view)?

    – Shashank Sawant
    May 17 '12 at 19:02








  • 2





    In Ubuntu, you normally install software for all users. Everything you do through the package manager is for all users. I don't understand the rest of your comment; one does not “configure” the “binary file associated with a software”. You should ask this as a separate question, and give a better explanation of what you're trying to do.

    – Gilles
    May 17 '12 at 19:05











  • Got it. I will frame a new question. Even then here's a short explanation of what I meant: In windows, the .exe files can be easily located. For example: "C:Python27python.exe". So I know where the program Python starts from. Now if I have to use the Eclipse IDE, I can simply point it to python.exe, and this is what I meant by "configure". I configured the IDE for Python. In Ubuntu where's the location where the program is installed? That is what still evades me.

    – Shashank Sawant
    May 17 '12 at 19:10








  • 2





    @Gilles Be careful when saying all. The GoboLinux project actually uses a more Windows like directory structure.

    – new123456
    May 18 '12 at 1:28








3




3





See also the directory-structure tag on Unix & Linux. All Linux distributions follow the same model.

– Gilles
May 17 '12 at 18:29





See also the directory-structure tag on Unix & Linux. All Linux distributions follow the same model.

– Gilles
May 17 '12 at 18:29













Thanks for all your answers. I am a bit confused about a few points: In Windows the setup usually provides through a prompt an option to install a software for all users. How to make that distinction in Ubuntu? Also, this is a usual problem in configuring development softwares to their IDEs. In windows, for example, in "program filesmiktexbin" there's the file "pdflatex.exe". Thus I can point the IDE to this file and configure it. How to go about this process in Ubuntu? Where's the general binary file associated with a software (esp. from the configuration point of view)?

– Shashank Sawant
May 17 '12 at 19:02







Thanks for all your answers. I am a bit confused about a few points: In Windows the setup usually provides through a prompt an option to install a software for all users. How to make that distinction in Ubuntu? Also, this is a usual problem in configuring development softwares to their IDEs. In windows, for example, in "program filesmiktexbin" there's the file "pdflatex.exe". Thus I can point the IDE to this file and configure it. How to go about this process in Ubuntu? Where's the general binary file associated with a software (esp. from the configuration point of view)?

– Shashank Sawant
May 17 '12 at 19:02






2




2





In Ubuntu, you normally install software for all users. Everything you do through the package manager is for all users. I don't understand the rest of your comment; one does not “configure” the “binary file associated with a software”. You should ask this as a separate question, and give a better explanation of what you're trying to do.

– Gilles
May 17 '12 at 19:05





In Ubuntu, you normally install software for all users. Everything you do through the package manager is for all users. I don't understand the rest of your comment; one does not “configure” the “binary file associated with a software”. You should ask this as a separate question, and give a better explanation of what you're trying to do.

– Gilles
May 17 '12 at 19:05













Got it. I will frame a new question. Even then here's a short explanation of what I meant: In windows, the .exe files can be easily located. For example: "C:Python27python.exe". So I know where the program Python starts from. Now if I have to use the Eclipse IDE, I can simply point it to python.exe, and this is what I meant by "configure". I configured the IDE for Python. In Ubuntu where's the location where the program is installed? That is what still evades me.

– Shashank Sawant
May 17 '12 at 19:10







Got it. I will frame a new question. Even then here's a short explanation of what I meant: In windows, the .exe files can be easily located. For example: "C:Python27python.exe". So I know where the program Python starts from. Now if I have to use the Eclipse IDE, I can simply point it to python.exe, and this is what I meant by "configure". I configured the IDE for Python. In Ubuntu where's the location where the program is installed? That is what still evades me.

– Shashank Sawant
May 17 '12 at 19:10






2




2





@Gilles Be careful when saying all. The GoboLinux project actually uses a more Windows like directory structure.

– new123456
May 18 '12 at 1:28





@Gilles Be careful when saying all. The GoboLinux project actually uses a more Windows like directory structure.

– new123456
May 18 '12 at 1:28










6 Answers
6






active

oldest

votes


















247














You can read up on this on for instance wikipedia. An excerpt:




The Filesystem Hierarchy Standard (FHS) defines the main directories and their contents in Linux operating systems. For the most part, it is a formalization and extension of the traditional BSD filesystem hierarchy.



The FHS is maintained by the Linux Foundation, a non-profit organization consisting of major software and hardware vendors, such as HP, Red Hat, IBM and Dell.
The current version is 3.0, released on June 3, 2015.




A visual representation with a short description:



enter image description here



Basically Linux has divided the directory structure based on the function of what is needed to make the system as secure as possible with the minimum amount of permissions needed. Otherwise someone is bound to have to do alot of avoidable work.



Remember that Unix and Linux where made as multi-user systems and Windows was created for a single user. Everything else can be explained from that idea. You can explain every directory when thinking about it being multi-user and security.



3 examples:




  • You will see that files and directories that are admin only are gathered in the same directory: the s in /sbin and /usr/sbin and /usr/local/sbin stands for system. A normal user can not even start programs that are in there. Files a normal user can start are in /bin, /usr/bin, /usr/local/bin based on where it most logically should reside. But if they are admin only they should go to the s version of that directory.
    There is a famous utility called fuser. You can kill processes with it. If a normal user could use this (s)he would be able to kill your session.


  • The same goes for /home: /home/user1 is property of user1. /home/user2 is property of user2. user2 has no business doing stuff in user1's home (and the other way around is also true: user1 has no business doing stuff in user2's home). If all the files would be in /home with no username underneath it you would have to give permissions to every file and asses if someone is allowed to write/remove those files. A nightmare if you have tens of users.



  • Addition regarding libraries.



    /lib/, /usr/lib/, and /usr/local/lib/ are the original locations, from before multilib
    systems existed and the exist to prevent breaking things. /usr/lib32, /usr/lib/64, /usr/local/lib32/, /usr/local/lib64/ are 32-/64-bit multilib inventions.




It is not a static concept by any means. Other Linux flavours made tweaks to this lay-out. For instance; currently you will see debian and Ubuntu changing a lot in the lay-out of the FHS since SSD is better off with read only files. There is a movement towards a new lay-out where files are split in to a 'read only' and a 'writable' directory/group so we can have a root partition that can be mounted read only (partition for a ssd) and writable (sata hdd).
The new directory that is used for this (not in the image) is /run/.






share|improve this answer





















  • 18





    +1 Rinzwind. I like the image, was actually looking for one.

    – Luis Alvarado
    May 17 '12 at 18:23






  • 5





    ha thought that would get attention :+ @LuisAlvarado

    – Rinzwind
    May 17 '12 at 18:24








  • 4





    There cannot be a better answer!

    – Shashank Sawant
    May 18 '12 at 20:44






  • 1





    Wasn't /mnt what /media is now, a few years ago?

    – RobinJ
    May 23 '12 at 10:47






  • 9





    @RobinJ: The diference is that /mnt has historically been manually managed. With the rise of many transient devices (flash drives, etc.) and auto-mounting becoming standard, there was a need to automatically handle mount points. A new directory was needed in order to avoid conflicts with existing manual configuration. Thus, these days /mnt has been relegated to the role of providing a convenient temporary mount point.

    – Scott Severance
    May 23 '12 at 11:06





















99














Give this command a try...



man 7 hier


You can also view this manual page here: http://manpages.ubuntu.com/manpages/en/man7/hier.7.html



Hope it helps






share|improve this answer





















  • 1





    good call! I always forget that one though it is always present (even when the net is down ;) )

    – Rinzwind
    May 17 '12 at 20:01






  • 1





    man should be renamed to "it". :)))

    – Shiki
    Dec 1 '13 at 23:11











  • man hier is now among my favourite commands! The explanations are clearer to me than the FHS doco, especially distinguishing between 'local to the machine' and 'site-wide', for an inexperienced Ubuntu user, crossing over from moderate DOS/Windows experience.

    – WillC
    Apr 6 '17 at 0:39













  • BTW the number 7 stands of the section Miscellanea of hier man page.

    – Pablo Bianchi
    Jan 27 '18 at 22:53











  • hmm. For what it's worth this kind of reminds me of a link-only answer, even though it's likely that every version of ubuntu will have this. Can you incorporate some of the content from the man page into your answer?

    – jrh
    Nov 15 '18 at 18:25



















41














Late Answer - I've created a roadmap for beginners to follow. If they are looking for a file but don't know where to look, they can use the map to roughly navigate around. You can download a hi-res PNG here. You can find the related post here. I will keep updating both the file and the post when time permits, incorporating helpful comments.








share|improve this answer


























  • Interesting and helpful idea to produce a flowchart, but unfortunately it seems to have some dead-ends. My question is if I am performing a mysqldump where should I output the file to?

    – BadHorsie
    Dec 17 '15 at 17:20











  • @BadHorsie of course it'd always depend on your specific use case, but dumping it in a /home/badhorsie/mysqldump directory would suffice. If you are running many apps you can create a new user to run each app and dump it in that app/user's home directory.

    – d4nyll
    Dec 19 '15 at 15:58











  • @paranoid-panda, could you expand a bit on why you choose not to allow the image to be clickable through the full-resolution? The version embedded in this post is pretty much unreadable.

    – waldyrious
    Jun 6 '16 at 11:31











  • @waldyrious: If you look at the revision history you will see that I only corrected a spelling mistake, it was another user who added the image in this particular way. Nothing to do with me. Feel free to edit it thought, I can't remember the correct syntax to make it click-able.

    – user364819
    Jun 6 '16 at 18:24











  • @ParanoidPanda that's precisely what I did. My edit made the typo fix and made the image clickable, and your review was to reject and edit, hence my question: what did you see wrong with making the image clickable?

    – waldyrious
    Jun 7 '16 at 15:48



















36














This following text shows the directory structure.



mtk4@laptop:/$ pwd
/
mtk4@laptop:/$ tree -L 1
.
|-- bin
|-- boot
|-- cdrom
|-- dev
|-- etc
|-- home
|-- lib
|-- lost+found
|-- media
|-- mnt
|-- opt
|-- proc
|-- root
|-- run
|-- sbin
|-- selinux
|-- srv
|-- sys
|-- tmp
|-- usr
|-- var


The main components here are:




  1. /boot : Contains the boot loader


  2. /home : Contains the home directories of users.


  3. /bin : All the executable binaries and commands used by all the users on the system are located here.


  4. /sbin : This contains the system executable binaries typically used by system administrators.


  5. /lib : Contains the system libraries that support the binaries in /bin and /sbin.


  6. /etc : Contains the configuration files for network, boot-time, etc.


  7. /dev : This has the device files i.e. usb, terminal device or any other device attached to the system are shown here.


  8. /proc : Contains information about the process running.


  9. /tmp : This is the temporary directory where many processes create the temporary files required. This is purged each time the machine is booted.



For more details, Thegeekstuff link perfectly explain the generic linux file-system.






share|improve this answer

































    20














    Users is equivalent to /home. The name of /usr is a historical artifact.



    The combined equivalent of Windows and Program Files is the combination of /bin, /boot, /etc, /lib, /sbin, /tmp, /usr and /var. Linux and Windows split up installed software differently. Windows distinguishes between the operating system and companion programs. Linux doesn't make this distinction in the same way; most if not all software comes through Ubuntu (the distributor) and is installed in the same directory hierarchy, and since software is tracked by the package manager, there is no need to store each program in its own directory. On Linux:





    • /etc is for system configuration files: configuration files that affect all users, whether they apply to the operating system as a whole or to a specific application.


    • /usr is for system code and data (programs, libraries, documentation, etc.).


    • /var is for variable or temporary data: temporary files, logs, package manager databases, printer spools, game save files, etc. There is also /tmp for temporary files that can be erased across reboots.


    • /bin, /lib and /sbin in the root directory have counterparts in /usr. The files that are outside /usr are the ones that are needed early in the boot process. This is a relic from the time when disks were small and /usr might be on a filesystem shared between several workstations over the network, it isn't really a useful distinction on most systems.


    • /boot contains a few files that are needed only to boot the operating system, and not for day-to-day operation.


    There are additional directories that don't correspond to anything that Windows has:





    • /root is the root user's home directory. The root user is an administrator account not tied to any particular user; it's the user that you change to when you run sudo. Ubuntu doesn't let the root user log in by default.


    • /media and /mnt are mount points: they're where you can see the filesystems of other operating systems and remote drives. The Windows equivalent is other drive letters.


    • /proc and /sys show system information. On Windows, you need to wade through menus or call system commands or install third-party programs to see this information.


    Ubuntu, like other Linux distributions, generally follows the Linux Filesystem Hierarchy Standard.






    share|improve this answer































      5














      Ubuntu (like all UNIX-like systems) organizes files in a hierarchical tree, where relationships are thought of in teams of children and parent. Directories can contain other directories as well as regular files, which are the "leaves" of the tree. Any element of the tree can be references by a path name; an absolute path name starts with the character / (identifying the root directory, which contains all other directories and files), then every child directory that must be traversed to reach the element is listed, each separated by a / sign.



      A relative path name is one that doesn't start with /; in that case, the directory tree is traversed starting from a given point, which changes depending on context, called the current directory. In every directory, there are two special directories called . and .., which refer respectively to the directory itself, and to its parent directory.



      The fact that all files and directories have a common root means that, even if several different storage devices are present on the system, they are all seen as directories somewhere in the tree, once they are mounted to the desired place



      Find examples and more information here:






      share|improve this answer


























      • Very good link. Thank you Stephen.

        – Luis Alvarado
        May 17 '12 at 18:26











      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f138547%2fhow-to-understand-the-ubuntu-file-system-layout%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      6 Answers
      6






      active

      oldest

      votes








      6 Answers
      6






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      247














      You can read up on this on for instance wikipedia. An excerpt:




      The Filesystem Hierarchy Standard (FHS) defines the main directories and their contents in Linux operating systems. For the most part, it is a formalization and extension of the traditional BSD filesystem hierarchy.



      The FHS is maintained by the Linux Foundation, a non-profit organization consisting of major software and hardware vendors, such as HP, Red Hat, IBM and Dell.
      The current version is 3.0, released on June 3, 2015.




      A visual representation with a short description:



      enter image description here



      Basically Linux has divided the directory structure based on the function of what is needed to make the system as secure as possible with the minimum amount of permissions needed. Otherwise someone is bound to have to do alot of avoidable work.



      Remember that Unix and Linux where made as multi-user systems and Windows was created for a single user. Everything else can be explained from that idea. You can explain every directory when thinking about it being multi-user and security.



      3 examples:




      • You will see that files and directories that are admin only are gathered in the same directory: the s in /sbin and /usr/sbin and /usr/local/sbin stands for system. A normal user can not even start programs that are in there. Files a normal user can start are in /bin, /usr/bin, /usr/local/bin based on where it most logically should reside. But if they are admin only they should go to the s version of that directory.
        There is a famous utility called fuser. You can kill processes with it. If a normal user could use this (s)he would be able to kill your session.


      • The same goes for /home: /home/user1 is property of user1. /home/user2 is property of user2. user2 has no business doing stuff in user1's home (and the other way around is also true: user1 has no business doing stuff in user2's home). If all the files would be in /home with no username underneath it you would have to give permissions to every file and asses if someone is allowed to write/remove those files. A nightmare if you have tens of users.



      • Addition regarding libraries.



        /lib/, /usr/lib/, and /usr/local/lib/ are the original locations, from before multilib
        systems existed and the exist to prevent breaking things. /usr/lib32, /usr/lib/64, /usr/local/lib32/, /usr/local/lib64/ are 32-/64-bit multilib inventions.




      It is not a static concept by any means. Other Linux flavours made tweaks to this lay-out. For instance; currently you will see debian and Ubuntu changing a lot in the lay-out of the FHS since SSD is better off with read only files. There is a movement towards a new lay-out where files are split in to a 'read only' and a 'writable' directory/group so we can have a root partition that can be mounted read only (partition for a ssd) and writable (sata hdd).
      The new directory that is used for this (not in the image) is /run/.






      share|improve this answer





















      • 18





        +1 Rinzwind. I like the image, was actually looking for one.

        – Luis Alvarado
        May 17 '12 at 18:23






      • 5





        ha thought that would get attention :+ @LuisAlvarado

        – Rinzwind
        May 17 '12 at 18:24








      • 4





        There cannot be a better answer!

        – Shashank Sawant
        May 18 '12 at 20:44






      • 1





        Wasn't /mnt what /media is now, a few years ago?

        – RobinJ
        May 23 '12 at 10:47






      • 9





        @RobinJ: The diference is that /mnt has historically been manually managed. With the rise of many transient devices (flash drives, etc.) and auto-mounting becoming standard, there was a need to automatically handle mount points. A new directory was needed in order to avoid conflicts with existing manual configuration. Thus, these days /mnt has been relegated to the role of providing a convenient temporary mount point.

        – Scott Severance
        May 23 '12 at 11:06


















      247














      You can read up on this on for instance wikipedia. An excerpt:




      The Filesystem Hierarchy Standard (FHS) defines the main directories and their contents in Linux operating systems. For the most part, it is a formalization and extension of the traditional BSD filesystem hierarchy.



      The FHS is maintained by the Linux Foundation, a non-profit organization consisting of major software and hardware vendors, such as HP, Red Hat, IBM and Dell.
      The current version is 3.0, released on June 3, 2015.




      A visual representation with a short description:



      enter image description here



      Basically Linux has divided the directory structure based on the function of what is needed to make the system as secure as possible with the minimum amount of permissions needed. Otherwise someone is bound to have to do alot of avoidable work.



      Remember that Unix and Linux where made as multi-user systems and Windows was created for a single user. Everything else can be explained from that idea. You can explain every directory when thinking about it being multi-user and security.



      3 examples:




      • You will see that files and directories that are admin only are gathered in the same directory: the s in /sbin and /usr/sbin and /usr/local/sbin stands for system. A normal user can not even start programs that are in there. Files a normal user can start are in /bin, /usr/bin, /usr/local/bin based on where it most logically should reside. But if they are admin only they should go to the s version of that directory.
        There is a famous utility called fuser. You can kill processes with it. If a normal user could use this (s)he would be able to kill your session.


      • The same goes for /home: /home/user1 is property of user1. /home/user2 is property of user2. user2 has no business doing stuff in user1's home (and the other way around is also true: user1 has no business doing stuff in user2's home). If all the files would be in /home with no username underneath it you would have to give permissions to every file and asses if someone is allowed to write/remove those files. A nightmare if you have tens of users.



      • Addition regarding libraries.



        /lib/, /usr/lib/, and /usr/local/lib/ are the original locations, from before multilib
        systems existed and the exist to prevent breaking things. /usr/lib32, /usr/lib/64, /usr/local/lib32/, /usr/local/lib64/ are 32-/64-bit multilib inventions.




      It is not a static concept by any means. Other Linux flavours made tweaks to this lay-out. For instance; currently you will see debian and Ubuntu changing a lot in the lay-out of the FHS since SSD is better off with read only files. There is a movement towards a new lay-out where files are split in to a 'read only' and a 'writable' directory/group so we can have a root partition that can be mounted read only (partition for a ssd) and writable (sata hdd).
      The new directory that is used for this (not in the image) is /run/.






      share|improve this answer





















      • 18





        +1 Rinzwind. I like the image, was actually looking for one.

        – Luis Alvarado
        May 17 '12 at 18:23






      • 5





        ha thought that would get attention :+ @LuisAlvarado

        – Rinzwind
        May 17 '12 at 18:24








      • 4





        There cannot be a better answer!

        – Shashank Sawant
        May 18 '12 at 20:44






      • 1





        Wasn't /mnt what /media is now, a few years ago?

        – RobinJ
        May 23 '12 at 10:47






      • 9





        @RobinJ: The diference is that /mnt has historically been manually managed. With the rise of many transient devices (flash drives, etc.) and auto-mounting becoming standard, there was a need to automatically handle mount points. A new directory was needed in order to avoid conflicts with existing manual configuration. Thus, these days /mnt has been relegated to the role of providing a convenient temporary mount point.

        – Scott Severance
        May 23 '12 at 11:06
















      247












      247








      247







      You can read up on this on for instance wikipedia. An excerpt:




      The Filesystem Hierarchy Standard (FHS) defines the main directories and their contents in Linux operating systems. For the most part, it is a formalization and extension of the traditional BSD filesystem hierarchy.



      The FHS is maintained by the Linux Foundation, a non-profit organization consisting of major software and hardware vendors, such as HP, Red Hat, IBM and Dell.
      The current version is 3.0, released on June 3, 2015.




      A visual representation with a short description:



      enter image description here



      Basically Linux has divided the directory structure based on the function of what is needed to make the system as secure as possible with the minimum amount of permissions needed. Otherwise someone is bound to have to do alot of avoidable work.



      Remember that Unix and Linux where made as multi-user systems and Windows was created for a single user. Everything else can be explained from that idea. You can explain every directory when thinking about it being multi-user and security.



      3 examples:




      • You will see that files and directories that are admin only are gathered in the same directory: the s in /sbin and /usr/sbin and /usr/local/sbin stands for system. A normal user can not even start programs that are in there. Files a normal user can start are in /bin, /usr/bin, /usr/local/bin based on where it most logically should reside. But if they are admin only they should go to the s version of that directory.
        There is a famous utility called fuser. You can kill processes with it. If a normal user could use this (s)he would be able to kill your session.


      • The same goes for /home: /home/user1 is property of user1. /home/user2 is property of user2. user2 has no business doing stuff in user1's home (and the other way around is also true: user1 has no business doing stuff in user2's home). If all the files would be in /home with no username underneath it you would have to give permissions to every file and asses if someone is allowed to write/remove those files. A nightmare if you have tens of users.



      • Addition regarding libraries.



        /lib/, /usr/lib/, and /usr/local/lib/ are the original locations, from before multilib
        systems existed and the exist to prevent breaking things. /usr/lib32, /usr/lib/64, /usr/local/lib32/, /usr/local/lib64/ are 32-/64-bit multilib inventions.




      It is not a static concept by any means. Other Linux flavours made tweaks to this lay-out. For instance; currently you will see debian and Ubuntu changing a lot in the lay-out of the FHS since SSD is better off with read only files. There is a movement towards a new lay-out where files are split in to a 'read only' and a 'writable' directory/group so we can have a root partition that can be mounted read only (partition for a ssd) and writable (sata hdd).
      The new directory that is used for this (not in the image) is /run/.






      share|improve this answer















      You can read up on this on for instance wikipedia. An excerpt:




      The Filesystem Hierarchy Standard (FHS) defines the main directories and their contents in Linux operating systems. For the most part, it is a formalization and extension of the traditional BSD filesystem hierarchy.



      The FHS is maintained by the Linux Foundation, a non-profit organization consisting of major software and hardware vendors, such as HP, Red Hat, IBM and Dell.
      The current version is 3.0, released on June 3, 2015.




      A visual representation with a short description:



      enter image description here



      Basically Linux has divided the directory structure based on the function of what is needed to make the system as secure as possible with the minimum amount of permissions needed. Otherwise someone is bound to have to do alot of avoidable work.



      Remember that Unix and Linux where made as multi-user systems and Windows was created for a single user. Everything else can be explained from that idea. You can explain every directory when thinking about it being multi-user and security.



      3 examples:




      • You will see that files and directories that are admin only are gathered in the same directory: the s in /sbin and /usr/sbin and /usr/local/sbin stands for system. A normal user can not even start programs that are in there. Files a normal user can start are in /bin, /usr/bin, /usr/local/bin based on where it most logically should reside. But if they are admin only they should go to the s version of that directory.
        There is a famous utility called fuser. You can kill processes with it. If a normal user could use this (s)he would be able to kill your session.


      • The same goes for /home: /home/user1 is property of user1. /home/user2 is property of user2. user2 has no business doing stuff in user1's home (and the other way around is also true: user1 has no business doing stuff in user2's home). If all the files would be in /home with no username underneath it you would have to give permissions to every file and asses if someone is allowed to write/remove those files. A nightmare if you have tens of users.



      • Addition regarding libraries.



        /lib/, /usr/lib/, and /usr/local/lib/ are the original locations, from before multilib
        systems existed and the exist to prevent breaking things. /usr/lib32, /usr/lib/64, /usr/local/lib32/, /usr/local/lib64/ are 32-/64-bit multilib inventions.




      It is not a static concept by any means. Other Linux flavours made tweaks to this lay-out. For instance; currently you will see debian and Ubuntu changing a lot in the lay-out of the FHS since SSD is better off with read only files. There is a movement towards a new lay-out where files are split in to a 'read only' and a 'writable' directory/group so we can have a root partition that can be mounted read only (partition for a ssd) and writable (sata hdd).
      The new directory that is used for this (not in the image) is /run/.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Oct 20 '15 at 14:26









      Amani

      1447




      1447










      answered May 17 '12 at 18:18









      RinzwindRinzwind

      206k28394526




      206k28394526








      • 18





        +1 Rinzwind. I like the image, was actually looking for one.

        – Luis Alvarado
        May 17 '12 at 18:23






      • 5





        ha thought that would get attention :+ @LuisAlvarado

        – Rinzwind
        May 17 '12 at 18:24








      • 4





        There cannot be a better answer!

        – Shashank Sawant
        May 18 '12 at 20:44






      • 1





        Wasn't /mnt what /media is now, a few years ago?

        – RobinJ
        May 23 '12 at 10:47






      • 9





        @RobinJ: The diference is that /mnt has historically been manually managed. With the rise of many transient devices (flash drives, etc.) and auto-mounting becoming standard, there was a need to automatically handle mount points. A new directory was needed in order to avoid conflicts with existing manual configuration. Thus, these days /mnt has been relegated to the role of providing a convenient temporary mount point.

        – Scott Severance
        May 23 '12 at 11:06
















      • 18





        +1 Rinzwind. I like the image, was actually looking for one.

        – Luis Alvarado
        May 17 '12 at 18:23






      • 5





        ha thought that would get attention :+ @LuisAlvarado

        – Rinzwind
        May 17 '12 at 18:24








      • 4





        There cannot be a better answer!

        – Shashank Sawant
        May 18 '12 at 20:44






      • 1





        Wasn't /mnt what /media is now, a few years ago?

        – RobinJ
        May 23 '12 at 10:47






      • 9





        @RobinJ: The diference is that /mnt has historically been manually managed. With the rise of many transient devices (flash drives, etc.) and auto-mounting becoming standard, there was a need to automatically handle mount points. A new directory was needed in order to avoid conflicts with existing manual configuration. Thus, these days /mnt has been relegated to the role of providing a convenient temporary mount point.

        – Scott Severance
        May 23 '12 at 11:06










      18




      18





      +1 Rinzwind. I like the image, was actually looking for one.

      – Luis Alvarado
      May 17 '12 at 18:23





      +1 Rinzwind. I like the image, was actually looking for one.

      – Luis Alvarado
      May 17 '12 at 18:23




      5




      5





      ha thought that would get attention :+ @LuisAlvarado

      – Rinzwind
      May 17 '12 at 18:24







      ha thought that would get attention :+ @LuisAlvarado

      – Rinzwind
      May 17 '12 at 18:24






      4




      4





      There cannot be a better answer!

      – Shashank Sawant
      May 18 '12 at 20:44





      There cannot be a better answer!

      – Shashank Sawant
      May 18 '12 at 20:44




      1




      1





      Wasn't /mnt what /media is now, a few years ago?

      – RobinJ
      May 23 '12 at 10:47





      Wasn't /mnt what /media is now, a few years ago?

      – RobinJ
      May 23 '12 at 10:47




      9




      9





      @RobinJ: The diference is that /mnt has historically been manually managed. With the rise of many transient devices (flash drives, etc.) and auto-mounting becoming standard, there was a need to automatically handle mount points. A new directory was needed in order to avoid conflicts with existing manual configuration. Thus, these days /mnt has been relegated to the role of providing a convenient temporary mount point.

      – Scott Severance
      May 23 '12 at 11:06







      @RobinJ: The diference is that /mnt has historically been manually managed. With the rise of many transient devices (flash drives, etc.) and auto-mounting becoming standard, there was a need to automatically handle mount points. A new directory was needed in order to avoid conflicts with existing manual configuration. Thus, these days /mnt has been relegated to the role of providing a convenient temporary mount point.

      – Scott Severance
      May 23 '12 at 11:06















      99














      Give this command a try...



      man 7 hier


      You can also view this manual page here: http://manpages.ubuntu.com/manpages/en/man7/hier.7.html



      Hope it helps






      share|improve this answer





















      • 1





        good call! I always forget that one though it is always present (even when the net is down ;) )

        – Rinzwind
        May 17 '12 at 20:01






      • 1





        man should be renamed to "it". :)))

        – Shiki
        Dec 1 '13 at 23:11











      • man hier is now among my favourite commands! The explanations are clearer to me than the FHS doco, especially distinguishing between 'local to the machine' and 'site-wide', for an inexperienced Ubuntu user, crossing over from moderate DOS/Windows experience.

        – WillC
        Apr 6 '17 at 0:39













      • BTW the number 7 stands of the section Miscellanea of hier man page.

        – Pablo Bianchi
        Jan 27 '18 at 22:53











      • hmm. For what it's worth this kind of reminds me of a link-only answer, even though it's likely that every version of ubuntu will have this. Can you incorporate some of the content from the man page into your answer?

        – jrh
        Nov 15 '18 at 18:25
















      99














      Give this command a try...



      man 7 hier


      You can also view this manual page here: http://manpages.ubuntu.com/manpages/en/man7/hier.7.html



      Hope it helps






      share|improve this answer





















      • 1





        good call! I always forget that one though it is always present (even when the net is down ;) )

        – Rinzwind
        May 17 '12 at 20:01






      • 1





        man should be renamed to "it". :)))

        – Shiki
        Dec 1 '13 at 23:11











      • man hier is now among my favourite commands! The explanations are clearer to me than the FHS doco, especially distinguishing between 'local to the machine' and 'site-wide', for an inexperienced Ubuntu user, crossing over from moderate DOS/Windows experience.

        – WillC
        Apr 6 '17 at 0:39













      • BTW the number 7 stands of the section Miscellanea of hier man page.

        – Pablo Bianchi
        Jan 27 '18 at 22:53











      • hmm. For what it's worth this kind of reminds me of a link-only answer, even though it's likely that every version of ubuntu will have this. Can you incorporate some of the content from the man page into your answer?

        – jrh
        Nov 15 '18 at 18:25














      99












      99








      99







      Give this command a try...



      man 7 hier


      You can also view this manual page here: http://manpages.ubuntu.com/manpages/en/man7/hier.7.html



      Hope it helps






      share|improve this answer















      Give this command a try...



      man 7 hier


      You can also view this manual page here: http://manpages.ubuntu.com/manpages/en/man7/hier.7.html



      Hope it helps







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Nov 15 '18 at 19:31









      Flimm

      21.4k1562122




      21.4k1562122










      answered May 17 '12 at 19:58









      Pritesh WadhiaPritesh Wadhia

      99952




      99952








      • 1





        good call! I always forget that one though it is always present (even when the net is down ;) )

        – Rinzwind
        May 17 '12 at 20:01






      • 1





        man should be renamed to "it". :)))

        – Shiki
        Dec 1 '13 at 23:11











      • man hier is now among my favourite commands! The explanations are clearer to me than the FHS doco, especially distinguishing between 'local to the machine' and 'site-wide', for an inexperienced Ubuntu user, crossing over from moderate DOS/Windows experience.

        – WillC
        Apr 6 '17 at 0:39













      • BTW the number 7 stands of the section Miscellanea of hier man page.

        – Pablo Bianchi
        Jan 27 '18 at 22:53











      • hmm. For what it's worth this kind of reminds me of a link-only answer, even though it's likely that every version of ubuntu will have this. Can you incorporate some of the content from the man page into your answer?

        – jrh
        Nov 15 '18 at 18:25














      • 1





        good call! I always forget that one though it is always present (even when the net is down ;) )

        – Rinzwind
        May 17 '12 at 20:01






      • 1





        man should be renamed to "it". :)))

        – Shiki
        Dec 1 '13 at 23:11











      • man hier is now among my favourite commands! The explanations are clearer to me than the FHS doco, especially distinguishing between 'local to the machine' and 'site-wide', for an inexperienced Ubuntu user, crossing over from moderate DOS/Windows experience.

        – WillC
        Apr 6 '17 at 0:39













      • BTW the number 7 stands of the section Miscellanea of hier man page.

        – Pablo Bianchi
        Jan 27 '18 at 22:53











      • hmm. For what it's worth this kind of reminds me of a link-only answer, even though it's likely that every version of ubuntu will have this. Can you incorporate some of the content from the man page into your answer?

        – jrh
        Nov 15 '18 at 18:25








      1




      1





      good call! I always forget that one though it is always present (even when the net is down ;) )

      – Rinzwind
      May 17 '12 at 20:01





      good call! I always forget that one though it is always present (even when the net is down ;) )

      – Rinzwind
      May 17 '12 at 20:01




      1




      1





      man should be renamed to "it". :)))

      – Shiki
      Dec 1 '13 at 23:11





      man should be renamed to "it". :)))

      – Shiki
      Dec 1 '13 at 23:11













      man hier is now among my favourite commands! The explanations are clearer to me than the FHS doco, especially distinguishing between 'local to the machine' and 'site-wide', for an inexperienced Ubuntu user, crossing over from moderate DOS/Windows experience.

      – WillC
      Apr 6 '17 at 0:39







      man hier is now among my favourite commands! The explanations are clearer to me than the FHS doco, especially distinguishing between 'local to the machine' and 'site-wide', for an inexperienced Ubuntu user, crossing over from moderate DOS/Windows experience.

      – WillC
      Apr 6 '17 at 0:39















      BTW the number 7 stands of the section Miscellanea of hier man page.

      – Pablo Bianchi
      Jan 27 '18 at 22:53





      BTW the number 7 stands of the section Miscellanea of hier man page.

      – Pablo Bianchi
      Jan 27 '18 at 22:53













      hmm. For what it's worth this kind of reminds me of a link-only answer, even though it's likely that every version of ubuntu will have this. Can you incorporate some of the content from the man page into your answer?

      – jrh
      Nov 15 '18 at 18:25





      hmm. For what it's worth this kind of reminds me of a link-only answer, even though it's likely that every version of ubuntu will have this. Can you incorporate some of the content from the man page into your answer?

      – jrh
      Nov 15 '18 at 18:25











      41














      Late Answer - I've created a roadmap for beginners to follow. If they are looking for a file but don't know where to look, they can use the map to roughly navigate around. You can download a hi-res PNG here. You can find the related post here. I will keep updating both the file and the post when time permits, incorporating helpful comments.








      share|improve this answer


























      • Interesting and helpful idea to produce a flowchart, but unfortunately it seems to have some dead-ends. My question is if I am performing a mysqldump where should I output the file to?

        – BadHorsie
        Dec 17 '15 at 17:20











      • @BadHorsie of course it'd always depend on your specific use case, but dumping it in a /home/badhorsie/mysqldump directory would suffice. If you are running many apps you can create a new user to run each app and dump it in that app/user's home directory.

        – d4nyll
        Dec 19 '15 at 15:58











      • @paranoid-panda, could you expand a bit on why you choose not to allow the image to be clickable through the full-resolution? The version embedded in this post is pretty much unreadable.

        – waldyrious
        Jun 6 '16 at 11:31











      • @waldyrious: If you look at the revision history you will see that I only corrected a spelling mistake, it was another user who added the image in this particular way. Nothing to do with me. Feel free to edit it thought, I can't remember the correct syntax to make it click-able.

        – user364819
        Jun 6 '16 at 18:24











      • @ParanoidPanda that's precisely what I did. My edit made the typo fix and made the image clickable, and your review was to reject and edit, hence my question: what did you see wrong with making the image clickable?

        – waldyrious
        Jun 7 '16 at 15:48
















      41














      Late Answer - I've created a roadmap for beginners to follow. If they are looking for a file but don't know where to look, they can use the map to roughly navigate around. You can download a hi-res PNG here. You can find the related post here. I will keep updating both the file and the post when time permits, incorporating helpful comments.








      share|improve this answer


























      • Interesting and helpful idea to produce a flowchart, but unfortunately it seems to have some dead-ends. My question is if I am performing a mysqldump where should I output the file to?

        – BadHorsie
        Dec 17 '15 at 17:20











      • @BadHorsie of course it'd always depend on your specific use case, but dumping it in a /home/badhorsie/mysqldump directory would suffice. If you are running many apps you can create a new user to run each app and dump it in that app/user's home directory.

        – d4nyll
        Dec 19 '15 at 15:58











      • @paranoid-panda, could you expand a bit on why you choose not to allow the image to be clickable through the full-resolution? The version embedded in this post is pretty much unreadable.

        – waldyrious
        Jun 6 '16 at 11:31











      • @waldyrious: If you look at the revision history you will see that I only corrected a spelling mistake, it was another user who added the image in this particular way. Nothing to do with me. Feel free to edit it thought, I can't remember the correct syntax to make it click-able.

        – user364819
        Jun 6 '16 at 18:24











      • @ParanoidPanda that's precisely what I did. My edit made the typo fix and made the image clickable, and your review was to reject and edit, hence my question: what did you see wrong with making the image clickable?

        – waldyrious
        Jun 7 '16 at 15:48














      41












      41








      41







      Late Answer - I've created a roadmap for beginners to follow. If they are looking for a file but don't know where to look, they can use the map to roughly navigate around. You can download a hi-res PNG here. You can find the related post here. I will keep updating both the file and the post when time permits, incorporating helpful comments.








      share|improve this answer















      Late Answer - I've created a roadmap for beginners to follow. If they are looking for a file but don't know where to look, they can use the map to roughly navigate around. You can download a hi-res PNG here. You can find the related post here. I will keep updating both the file and the post when time permits, incorporating helpful comments.









      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jun 7 '16 at 17:40









      waldyrious

      1,32421632




      1,32421632










      answered Nov 20 '14 at 18:18









      d4nylld4nyll

      1,327912




      1,327912













      • Interesting and helpful idea to produce a flowchart, but unfortunately it seems to have some dead-ends. My question is if I am performing a mysqldump where should I output the file to?

        – BadHorsie
        Dec 17 '15 at 17:20











      • @BadHorsie of course it'd always depend on your specific use case, but dumping it in a /home/badhorsie/mysqldump directory would suffice. If you are running many apps you can create a new user to run each app and dump it in that app/user's home directory.

        – d4nyll
        Dec 19 '15 at 15:58











      • @paranoid-panda, could you expand a bit on why you choose not to allow the image to be clickable through the full-resolution? The version embedded in this post is pretty much unreadable.

        – waldyrious
        Jun 6 '16 at 11:31











      • @waldyrious: If you look at the revision history you will see that I only corrected a spelling mistake, it was another user who added the image in this particular way. Nothing to do with me. Feel free to edit it thought, I can't remember the correct syntax to make it click-able.

        – user364819
        Jun 6 '16 at 18:24











      • @ParanoidPanda that's precisely what I did. My edit made the typo fix and made the image clickable, and your review was to reject and edit, hence my question: what did you see wrong with making the image clickable?

        – waldyrious
        Jun 7 '16 at 15:48



















      • Interesting and helpful idea to produce a flowchart, but unfortunately it seems to have some dead-ends. My question is if I am performing a mysqldump where should I output the file to?

        – BadHorsie
        Dec 17 '15 at 17:20











      • @BadHorsie of course it'd always depend on your specific use case, but dumping it in a /home/badhorsie/mysqldump directory would suffice. If you are running many apps you can create a new user to run each app and dump it in that app/user's home directory.

        – d4nyll
        Dec 19 '15 at 15:58











      • @paranoid-panda, could you expand a bit on why you choose not to allow the image to be clickable through the full-resolution? The version embedded in this post is pretty much unreadable.

        – waldyrious
        Jun 6 '16 at 11:31











      • @waldyrious: If you look at the revision history you will see that I only corrected a spelling mistake, it was another user who added the image in this particular way. Nothing to do with me. Feel free to edit it thought, I can't remember the correct syntax to make it click-able.

        – user364819
        Jun 6 '16 at 18:24











      • @ParanoidPanda that's precisely what I did. My edit made the typo fix and made the image clickable, and your review was to reject and edit, hence my question: what did you see wrong with making the image clickable?

        – waldyrious
        Jun 7 '16 at 15:48

















      Interesting and helpful idea to produce a flowchart, but unfortunately it seems to have some dead-ends. My question is if I am performing a mysqldump where should I output the file to?

      – BadHorsie
      Dec 17 '15 at 17:20





      Interesting and helpful idea to produce a flowchart, but unfortunately it seems to have some dead-ends. My question is if I am performing a mysqldump where should I output the file to?

      – BadHorsie
      Dec 17 '15 at 17:20













      @BadHorsie of course it'd always depend on your specific use case, but dumping it in a /home/badhorsie/mysqldump directory would suffice. If you are running many apps you can create a new user to run each app and dump it in that app/user's home directory.

      – d4nyll
      Dec 19 '15 at 15:58





      @BadHorsie of course it'd always depend on your specific use case, but dumping it in a /home/badhorsie/mysqldump directory would suffice. If you are running many apps you can create a new user to run each app and dump it in that app/user's home directory.

      – d4nyll
      Dec 19 '15 at 15:58













      @paranoid-panda, could you expand a bit on why you choose not to allow the image to be clickable through the full-resolution? The version embedded in this post is pretty much unreadable.

      – waldyrious
      Jun 6 '16 at 11:31





      @paranoid-panda, could you expand a bit on why you choose not to allow the image to be clickable through the full-resolution? The version embedded in this post is pretty much unreadable.

      – waldyrious
      Jun 6 '16 at 11:31













      @waldyrious: If you look at the revision history you will see that I only corrected a spelling mistake, it was another user who added the image in this particular way. Nothing to do with me. Feel free to edit it thought, I can't remember the correct syntax to make it click-able.

      – user364819
      Jun 6 '16 at 18:24





      @waldyrious: If you look at the revision history you will see that I only corrected a spelling mistake, it was another user who added the image in this particular way. Nothing to do with me. Feel free to edit it thought, I can't remember the correct syntax to make it click-able.

      – user364819
      Jun 6 '16 at 18:24













      @ParanoidPanda that's precisely what I did. My edit made the typo fix and made the image clickable, and your review was to reject and edit, hence my question: what did you see wrong with making the image clickable?

      – waldyrious
      Jun 7 '16 at 15:48





      @ParanoidPanda that's precisely what I did. My edit made the typo fix and made the image clickable, and your review was to reject and edit, hence my question: what did you see wrong with making the image clickable?

      – waldyrious
      Jun 7 '16 at 15:48











      36














      This following text shows the directory structure.



      mtk4@laptop:/$ pwd
      /
      mtk4@laptop:/$ tree -L 1
      .
      |-- bin
      |-- boot
      |-- cdrom
      |-- dev
      |-- etc
      |-- home
      |-- lib
      |-- lost+found
      |-- media
      |-- mnt
      |-- opt
      |-- proc
      |-- root
      |-- run
      |-- sbin
      |-- selinux
      |-- srv
      |-- sys
      |-- tmp
      |-- usr
      |-- var


      The main components here are:




      1. /boot : Contains the boot loader


      2. /home : Contains the home directories of users.


      3. /bin : All the executable binaries and commands used by all the users on the system are located here.


      4. /sbin : This contains the system executable binaries typically used by system administrators.


      5. /lib : Contains the system libraries that support the binaries in /bin and /sbin.


      6. /etc : Contains the configuration files for network, boot-time, etc.


      7. /dev : This has the device files i.e. usb, terminal device or any other device attached to the system are shown here.


      8. /proc : Contains information about the process running.


      9. /tmp : This is the temporary directory where many processes create the temporary files required. This is purged each time the machine is booted.



      For more details, Thegeekstuff link perfectly explain the generic linux file-system.






      share|improve this answer






























        36














        This following text shows the directory structure.



        mtk4@laptop:/$ pwd
        /
        mtk4@laptop:/$ tree -L 1
        .
        |-- bin
        |-- boot
        |-- cdrom
        |-- dev
        |-- etc
        |-- home
        |-- lib
        |-- lost+found
        |-- media
        |-- mnt
        |-- opt
        |-- proc
        |-- root
        |-- run
        |-- sbin
        |-- selinux
        |-- srv
        |-- sys
        |-- tmp
        |-- usr
        |-- var


        The main components here are:




        1. /boot : Contains the boot loader


        2. /home : Contains the home directories of users.


        3. /bin : All the executable binaries and commands used by all the users on the system are located here.


        4. /sbin : This contains the system executable binaries typically used by system administrators.


        5. /lib : Contains the system libraries that support the binaries in /bin and /sbin.


        6. /etc : Contains the configuration files for network, boot-time, etc.


        7. /dev : This has the device files i.e. usb, terminal device or any other device attached to the system are shown here.


        8. /proc : Contains information about the process running.


        9. /tmp : This is the temporary directory where many processes create the temporary files required. This is purged each time the machine is booted.



        For more details, Thegeekstuff link perfectly explain the generic linux file-system.






        share|improve this answer




























          36












          36








          36







          This following text shows the directory structure.



          mtk4@laptop:/$ pwd
          /
          mtk4@laptop:/$ tree -L 1
          .
          |-- bin
          |-- boot
          |-- cdrom
          |-- dev
          |-- etc
          |-- home
          |-- lib
          |-- lost+found
          |-- media
          |-- mnt
          |-- opt
          |-- proc
          |-- root
          |-- run
          |-- sbin
          |-- selinux
          |-- srv
          |-- sys
          |-- tmp
          |-- usr
          |-- var


          The main components here are:




          1. /boot : Contains the boot loader


          2. /home : Contains the home directories of users.


          3. /bin : All the executable binaries and commands used by all the users on the system are located here.


          4. /sbin : This contains the system executable binaries typically used by system administrators.


          5. /lib : Contains the system libraries that support the binaries in /bin and /sbin.


          6. /etc : Contains the configuration files for network, boot-time, etc.


          7. /dev : This has the device files i.e. usb, terminal device or any other device attached to the system are shown here.


          8. /proc : Contains information about the process running.


          9. /tmp : This is the temporary directory where many processes create the temporary files required. This is purged each time the machine is booted.



          For more details, Thegeekstuff link perfectly explain the generic linux file-system.






          share|improve this answer















          This following text shows the directory structure.



          mtk4@laptop:/$ pwd
          /
          mtk4@laptop:/$ tree -L 1
          .
          |-- bin
          |-- boot
          |-- cdrom
          |-- dev
          |-- etc
          |-- home
          |-- lib
          |-- lost+found
          |-- media
          |-- mnt
          |-- opt
          |-- proc
          |-- root
          |-- run
          |-- sbin
          |-- selinux
          |-- srv
          |-- sys
          |-- tmp
          |-- usr
          |-- var


          The main components here are:




          1. /boot : Contains the boot loader


          2. /home : Contains the home directories of users.


          3. /bin : All the executable binaries and commands used by all the users on the system are located here.


          4. /sbin : This contains the system executable binaries typically used by system administrators.


          5. /lib : Contains the system libraries that support the binaries in /bin and /sbin.


          6. /etc : Contains the configuration files for network, boot-time, etc.


          7. /dev : This has the device files i.e. usb, terminal device or any other device attached to the system are shown here.


          8. /proc : Contains information about the process running.


          9. /tmp : This is the temporary directory where many processes create the temporary files required. This is purged each time the machine is booted.



          For more details, Thegeekstuff link perfectly explain the generic linux file-system.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 17 '12 at 19:10

























          answered May 17 '12 at 18:38









          mtkmtk

          516518




          516518























              20














              Users is equivalent to /home. The name of /usr is a historical artifact.



              The combined equivalent of Windows and Program Files is the combination of /bin, /boot, /etc, /lib, /sbin, /tmp, /usr and /var. Linux and Windows split up installed software differently. Windows distinguishes between the operating system and companion programs. Linux doesn't make this distinction in the same way; most if not all software comes through Ubuntu (the distributor) and is installed in the same directory hierarchy, and since software is tracked by the package manager, there is no need to store each program in its own directory. On Linux:





              • /etc is for system configuration files: configuration files that affect all users, whether they apply to the operating system as a whole or to a specific application.


              • /usr is for system code and data (programs, libraries, documentation, etc.).


              • /var is for variable or temporary data: temporary files, logs, package manager databases, printer spools, game save files, etc. There is also /tmp for temporary files that can be erased across reboots.


              • /bin, /lib and /sbin in the root directory have counterparts in /usr. The files that are outside /usr are the ones that are needed early in the boot process. This is a relic from the time when disks were small and /usr might be on a filesystem shared between several workstations over the network, it isn't really a useful distinction on most systems.


              • /boot contains a few files that are needed only to boot the operating system, and not for day-to-day operation.


              There are additional directories that don't correspond to anything that Windows has:





              • /root is the root user's home directory. The root user is an administrator account not tied to any particular user; it's the user that you change to when you run sudo. Ubuntu doesn't let the root user log in by default.


              • /media and /mnt are mount points: they're where you can see the filesystems of other operating systems and remote drives. The Windows equivalent is other drive letters.


              • /proc and /sys show system information. On Windows, you need to wade through menus or call system commands or install third-party programs to see this information.


              Ubuntu, like other Linux distributions, generally follows the Linux Filesystem Hierarchy Standard.






              share|improve this answer




























                20














                Users is equivalent to /home. The name of /usr is a historical artifact.



                The combined equivalent of Windows and Program Files is the combination of /bin, /boot, /etc, /lib, /sbin, /tmp, /usr and /var. Linux and Windows split up installed software differently. Windows distinguishes between the operating system and companion programs. Linux doesn't make this distinction in the same way; most if not all software comes through Ubuntu (the distributor) and is installed in the same directory hierarchy, and since software is tracked by the package manager, there is no need to store each program in its own directory. On Linux:





                • /etc is for system configuration files: configuration files that affect all users, whether they apply to the operating system as a whole or to a specific application.


                • /usr is for system code and data (programs, libraries, documentation, etc.).


                • /var is for variable or temporary data: temporary files, logs, package manager databases, printer spools, game save files, etc. There is also /tmp for temporary files that can be erased across reboots.


                • /bin, /lib and /sbin in the root directory have counterparts in /usr. The files that are outside /usr are the ones that are needed early in the boot process. This is a relic from the time when disks were small and /usr might be on a filesystem shared between several workstations over the network, it isn't really a useful distinction on most systems.


                • /boot contains a few files that are needed only to boot the operating system, and not for day-to-day operation.


                There are additional directories that don't correspond to anything that Windows has:





                • /root is the root user's home directory. The root user is an administrator account not tied to any particular user; it's the user that you change to when you run sudo. Ubuntu doesn't let the root user log in by default.


                • /media and /mnt are mount points: they're where you can see the filesystems of other operating systems and remote drives. The Windows equivalent is other drive letters.


                • /proc and /sys show system information. On Windows, you need to wade through menus or call system commands or install third-party programs to see this information.


                Ubuntu, like other Linux distributions, generally follows the Linux Filesystem Hierarchy Standard.






                share|improve this answer


























                  20












                  20








                  20







                  Users is equivalent to /home. The name of /usr is a historical artifact.



                  The combined equivalent of Windows and Program Files is the combination of /bin, /boot, /etc, /lib, /sbin, /tmp, /usr and /var. Linux and Windows split up installed software differently. Windows distinguishes between the operating system and companion programs. Linux doesn't make this distinction in the same way; most if not all software comes through Ubuntu (the distributor) and is installed in the same directory hierarchy, and since software is tracked by the package manager, there is no need to store each program in its own directory. On Linux:





                  • /etc is for system configuration files: configuration files that affect all users, whether they apply to the operating system as a whole or to a specific application.


                  • /usr is for system code and data (programs, libraries, documentation, etc.).


                  • /var is for variable or temporary data: temporary files, logs, package manager databases, printer spools, game save files, etc. There is also /tmp for temporary files that can be erased across reboots.


                  • /bin, /lib and /sbin in the root directory have counterparts in /usr. The files that are outside /usr are the ones that are needed early in the boot process. This is a relic from the time when disks were small and /usr might be on a filesystem shared between several workstations over the network, it isn't really a useful distinction on most systems.


                  • /boot contains a few files that are needed only to boot the operating system, and not for day-to-day operation.


                  There are additional directories that don't correspond to anything that Windows has:





                  • /root is the root user's home directory. The root user is an administrator account not tied to any particular user; it's the user that you change to when you run sudo. Ubuntu doesn't let the root user log in by default.


                  • /media and /mnt are mount points: they're where you can see the filesystems of other operating systems and remote drives. The Windows equivalent is other drive letters.


                  • /proc and /sys show system information. On Windows, you need to wade through menus or call system commands or install third-party programs to see this information.


                  Ubuntu, like other Linux distributions, generally follows the Linux Filesystem Hierarchy Standard.






                  share|improve this answer













                  Users is equivalent to /home. The name of /usr is a historical artifact.



                  The combined equivalent of Windows and Program Files is the combination of /bin, /boot, /etc, /lib, /sbin, /tmp, /usr and /var. Linux and Windows split up installed software differently. Windows distinguishes between the operating system and companion programs. Linux doesn't make this distinction in the same way; most if not all software comes through Ubuntu (the distributor) and is installed in the same directory hierarchy, and since software is tracked by the package manager, there is no need to store each program in its own directory. On Linux:





                  • /etc is for system configuration files: configuration files that affect all users, whether they apply to the operating system as a whole or to a specific application.


                  • /usr is for system code and data (programs, libraries, documentation, etc.).


                  • /var is for variable or temporary data: temporary files, logs, package manager databases, printer spools, game save files, etc. There is also /tmp for temporary files that can be erased across reboots.


                  • /bin, /lib and /sbin in the root directory have counterparts in /usr. The files that are outside /usr are the ones that are needed early in the boot process. This is a relic from the time when disks were small and /usr might be on a filesystem shared between several workstations over the network, it isn't really a useful distinction on most systems.


                  • /boot contains a few files that are needed only to boot the operating system, and not for day-to-day operation.


                  There are additional directories that don't correspond to anything that Windows has:





                  • /root is the root user's home directory. The root user is an administrator account not tied to any particular user; it's the user that you change to when you run sudo. Ubuntu doesn't let the root user log in by default.


                  • /media and /mnt are mount points: they're where you can see the filesystems of other operating systems and remote drives. The Windows equivalent is other drive letters.


                  • /proc and /sys show system information. On Windows, you need to wade through menus or call system commands or install third-party programs to see this information.


                  Ubuntu, like other Linux distributions, generally follows the Linux Filesystem Hierarchy Standard.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 17 '12 at 18:48









                  GillesGilles

                  44.9k13102141




                  44.9k13102141























                      5














                      Ubuntu (like all UNIX-like systems) organizes files in a hierarchical tree, where relationships are thought of in teams of children and parent. Directories can contain other directories as well as regular files, which are the "leaves" of the tree. Any element of the tree can be references by a path name; an absolute path name starts with the character / (identifying the root directory, which contains all other directories and files), then every child directory that must be traversed to reach the element is listed, each separated by a / sign.



                      A relative path name is one that doesn't start with /; in that case, the directory tree is traversed starting from a given point, which changes depending on context, called the current directory. In every directory, there are two special directories called . and .., which refer respectively to the directory itself, and to its parent directory.



                      The fact that all files and directories have a common root means that, even if several different storage devices are present on the system, they are all seen as directories somewhere in the tree, once they are mounted to the desired place



                      Find examples and more information here:






                      share|improve this answer


























                      • Very good link. Thank you Stephen.

                        – Luis Alvarado
                        May 17 '12 at 18:26
















                      5














                      Ubuntu (like all UNIX-like systems) organizes files in a hierarchical tree, where relationships are thought of in teams of children and parent. Directories can contain other directories as well as regular files, which are the "leaves" of the tree. Any element of the tree can be references by a path name; an absolute path name starts with the character / (identifying the root directory, which contains all other directories and files), then every child directory that must be traversed to reach the element is listed, each separated by a / sign.



                      A relative path name is one that doesn't start with /; in that case, the directory tree is traversed starting from a given point, which changes depending on context, called the current directory. In every directory, there are two special directories called . and .., which refer respectively to the directory itself, and to its parent directory.



                      The fact that all files and directories have a common root means that, even if several different storage devices are present on the system, they are all seen as directories somewhere in the tree, once they are mounted to the desired place



                      Find examples and more information here:






                      share|improve this answer


























                      • Very good link. Thank you Stephen.

                        – Luis Alvarado
                        May 17 '12 at 18:26














                      5












                      5








                      5







                      Ubuntu (like all UNIX-like systems) organizes files in a hierarchical tree, where relationships are thought of in teams of children and parent. Directories can contain other directories as well as regular files, which are the "leaves" of the tree. Any element of the tree can be references by a path name; an absolute path name starts with the character / (identifying the root directory, which contains all other directories and files), then every child directory that must be traversed to reach the element is listed, each separated by a / sign.



                      A relative path name is one that doesn't start with /; in that case, the directory tree is traversed starting from a given point, which changes depending on context, called the current directory. In every directory, there are two special directories called . and .., which refer respectively to the directory itself, and to its parent directory.



                      The fact that all files and directories have a common root means that, even if several different storage devices are present on the system, they are all seen as directories somewhere in the tree, once they are mounted to the desired place



                      Find examples and more information here:






                      share|improve this answer















                      Ubuntu (like all UNIX-like systems) organizes files in a hierarchical tree, where relationships are thought of in teams of children and parent. Directories can contain other directories as well as regular files, which are the "leaves" of the tree. Any element of the tree can be references by a path name; an absolute path name starts with the character / (identifying the root directory, which contains all other directories and files), then every child directory that must be traversed to reach the element is listed, each separated by a / sign.



                      A relative path name is one that doesn't start with /; in that case, the directory tree is traversed starting from a given point, which changes depending on context, called the current directory. In every directory, there are two special directories called . and .., which refer respectively to the directory itself, and to its parent directory.



                      The fact that all files and directories have a common root means that, even if several different storage devices are present on the system, they are all seen as directories somewhere in the tree, once they are mounted to the desired place



                      Find examples and more information here:







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited May 18 '12 at 10:37

























                      answered May 17 '12 at 18:18









                      stephenmyallstephenmyall

                      7,353133967




                      7,353133967













                      • Very good link. Thank you Stephen.

                        – Luis Alvarado
                        May 17 '12 at 18:26



















                      • Very good link. Thank you Stephen.

                        – Luis Alvarado
                        May 17 '12 at 18:26

















                      Very good link. Thank you Stephen.

                      – Luis Alvarado
                      May 17 '12 at 18:26





                      Very good link. Thank you Stephen.

                      – Luis Alvarado
                      May 17 '12 at 18:26


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f138547%2fhow-to-understand-the-ubuntu-file-system-layout%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅