Networking / Beginners

Understanding the file system

The Linux file system is a bit different from the Windows file system. Two of the most obvious differences are actually superficial:

  • Linux uses forward slashes rather than backward slashes to separate directories. Thus, /home/doug is a valid path in Linux; \Windows\System32 is a valid path in Windows.
  • Linux filenames don't use extensions. You can use periods within a filename, but unlike Windows, the final period doesn't identify a file extension.

The fundamental difference between the Linux and Windows file system is that Linux treats everything in the entire system as a file, and it organizes everything into one gigantic tree that begins at a single root. When I say, "Everything is treated as a file," I mean that hardware devices such as floppy drives, serial ports, and Ethernet adapters are treated as files.

The root of the Linux file system is the root partition from which the operating system boots. Additional partitions, including other devices that support file systems such as CD-ROM drives, floppy drives, or drives accessed over the network, can be grafted into the tree as directories called mount points. Thus, a directory in the Linux file system may actually be a separate hard drive.

Another important aspect of the Linux file system is that the directories that compose a Linux system are governed by a standard called the Filesystem Hierarchy Standard (FHS). This standard spells out which directories a Linux file system should have. Because most Linux systems conform to this standard, you can trust that key files will always be found in the same place.

Table-1 lists the top-level directories that are described in the FHS.

Top-Level Directories in a Linux File System
Directory 	Description
/bin 		Essential command binaries
/boot 		Static files of the boot loader
/dev 		Devices
/etc 		Configuration files for the local computer
/home 		Home directories for users
/lib 		Shared libraries and kernel modules
/mnt 		Mount point for file systems mounted temporarily
/opt 		Add-on applications and packages
/root 		Home directory for the root user
/sbin 		Essential system binaries
/tmp 		Temporary files
/usr 		Read-only, shared files such as binaries for user 
		commands and libraries
/var 		Variable data files
[Previous] [Contents] [Next]