Understanding the File System and Structure in Linux

Understanding the File System and Structure in Linux

17 Comments on Understanding the File System and Structure in Linux

The file system in Linux can be intimidating coming from other operating systems like Microsoft Windows. At first glance it may seem that there is no organisation to the files, but there is a method to this madness. After spending some more time with the file system in Linux, it will seem a lot more secure and organised.

File System
Linux supports many file systems such as EXT4, BTRFS and FAT32. In many of the file systems that Linux uses, file names are case sensitive. Network file systems such as SMB and NFS can be mounted permanently on a directory if it is available and online.

The Structure
The file structure in Linux is very different to the file system in Microsoft Windows. Windows separates partitions into drives identified by a letter followed by a colon punctuation mark (:). The advantage is if an application is causing damage to the drive recursively, the data on a drive identified by a different letter will be safe.

In Linux, partitions are mounted in empty directories, which is great for applications like media centres that scans a directory to identify media. New drives can be added to the system for new media and mounted inside the existing directory structure for scanning.

The Home Directory
Both Windows and Linux store configuration files for some applications in the user home directory. This enables applications to store different configurations for different users.

Users in both Windows and Linux have full permissions to create, edit and delete files in the users home directory only if a file or directory was not created by a different user such as an administrator.

Hidden Files
In windows any folder and file can hidden by adjusting the properties of the folder or file.

In Linux if a file or folder starts with a period (.), it is hidden. Hidden files can be viewed in Linux with Nautilus by pressing “CTRL and H” and with Dolphin by pressing “CTRL and .”. Using the command line, hidden files can be viewed by adding -a to the ls command.

ls -a

The Registry
Windows holds a lot of important information needed by the operating system and applications in the registry. The registry is a database of directories, keys and values. The registry in Windows can be edited with the following command:


In Linux this information is stored in the users home directory for information specific to the user and in the /etc directory for global configurations. Linux configuration files are standard text files that can be edited manually. Many of these configuration files have graphical editors now.

Log Files
Windows applications usually store log files for applications in the users home directory or in the same directory the application was installed. This is not definite as there is no real structure for Windows and logging.

In Linux, log files are stored in the /var/log directory. There are many graphical applications that will display log information. To see the last few lines of a log file in the console, the tail command can be used:

tail myfile.log

Installed Applications
In Windows applications are usually installed with an installer such as the Microsoft Installer. The installer will ask for administrative permissions and install the files required. Applications are usually stored in the program files directory. Shared files are stored in the system directories located in the windows directory. Drivers are stored in the driver directory located in the system directories.

Applications in Linux are usually installed with the package manager that is used by the Linux distribution. Linux packages help with installing dependencies and even uninstalling. There is also the option of installing applications from source code. a Make file included with the source code will compile and install the files in the right locations.

Binary files in Linux are stored in the bin directory such as /usr/bin and the libraries for the binaries are stored in /usr/lib. Some optional applications can be stored in the /opt directory

The /bin directory is for standard Linux applications such as ls, grep and cp. The /lib directory stores libraries for the binaries in the /bin directory

System binaries are stored in /sbin for standard Linux applications and /usr/sbin for user applications.

In Linux, devices are represented as empty files. This can come in handy for many reasons. One is to play a DVD movie by pointing to the optical device directly:

mplayer dvd://1 -dvd-device /dev/dvd

A list of devices in the dev directory can be displayed with the following command:

ls /dev

Mounted Devices
Optical, USB and other removable devices are mounted automatically at /media or /mnt which is a mount point (empty directory)  for mounting devices, networks, etc at a temporary location. These mountable devices can be mounted anywhere but are usually mounted at /mnt or /media.

Temporary Files
In Windows temporary files are stored in the appdata directory located in the users directory such as C:\Users\username\AppData\Local\Temp.

Linux stores temporary files in the /tmp directory. Some applications may store temporary files as a hidden file or in a hidden directory in the users home directory.

About the author:

Bill Payne started working as a paid professional software developer at the young age of 12 years old developing simple games and other applications for pre-packaged computers. Bill has since developed software for many industries such as direct sales and the the stock market. Bill has now started sharing his many years of software development experience through a blog on the MPSHouse website and one on one lessons.


  1. Dude  - 15 September , 2011 - 3:25 pm
    Reply /

    Very good overview and comparison, mate!

    • bill  - 15 September , 2011 - 7:46 pm
      Reply /

      Thank you. I am glad you enjoyed it.

      • Belle  - 29 September , 2011 - 9:22 pm
        Reply /

        I love rediang these articles because they’re short but informative.

  2. jsp722  - 15 September , 2011 - 10:34 pm
    Reply /

    I think that in order to see hidden files in KDE, the key combination is “Alt+.”, rather than “Ctrl+.”.

    • bill  - 20 September , 2011 - 12:23 am
      Reply /

      I think you a right. I double checked with another site which had the same key combination as my article, but the documentation says “Alt + .”
      Thank you so much for letting me know and I will update my atricle.

  3. alex_from_somewhere  - 16 September , 2011 - 7:14 am
    Reply /

    Thx for this.
    The linux file system can be a bit confusing for newbs like me.

    • bill  - 20 September , 2011 - 12:26 am
      Reply /

      I’m glad I was able to help. Thanks for reading!

    • Luviani  - 4 February , 2012 - 9:46 pm
      Reply /

      ""Makefile Full path of the file – /usr/src/linux- Create a new doetcriry newcall/ under the folder /usr/src/linux- and include that path to /usr/src/linux-"""can you please explain this part in a more simple way?i didn't understand where should i add the path..please thanks in advance

  4. Reply /

    […] Understanding the File System and Structure in Linux The file system in Linux can be intimidating coming from other operating systems like Microsoft Windows. At first glance it may seem that there is no organisation to the files, but there is a method to this madness. After spending some more time with the file system in Linux, it will seem a lot more secure and organised. […]

  5. aa  - 20 September , 2011 - 4:56 am
    Reply /

    can you explain where installed programs go
    which directories
    tarball and repo install

    and how to add/remove that program in gnome/kde menus
    how to change program menu’s place

    • bill  - 20 September , 2011 - 10:40 pm
      Reply /

      A tar file is a file that is meant to hold more than one file with the directory structure. These files go where the creator of the file has set in the directory structure. Both KDE and Gnome have a menu editor for the main menu. In KDE the menu editor is “kmenuedit” and in Gnome it is “update-menus”.

      Removing applications depends on how you installed them. If you installed them in a package manager then remove them with the package manager. If they where installed with a make file then usually the command is “make uninstall”.

      Hope this helps…

  6. neeraj  - 29 September , 2011 - 2:34 am
    Reply /

    Thanks for the useful information

Leave a comment

Back to Top