Note
To get a complete understanding of the Linux file system, recommended reading is the Linux Filesystem Hierarchy documentation hosted by The Linux Documentation Project.
A filesystem is a method of storing and organizing files, not only in Linux but also in other computer operating systems. In Linux, most files are “regular files”, except directories, special files, links, sockets, and named pipes. The most common filetypes that users interact with are regular files, directories and links.
Öppna en terminal (i Kubuntu kallas detta för Konsole) och skriv
ls /
ger en lista som liknar följande:
bin boot cdrom dev etc home initrd.img lib lib32 lib64 lost+found media mnt proc root sbin selinux srv sys tmp usr var vmlinuz
Note
Alla listor kommer inte att se ut exakt som den ovan.
Följande är en översikt över filerna eller katalogerna som listats ovan.
Översikt av filsystemet
binContains terminal commands that are useful to system administrators (who have full access privileges) and to regular users (who have limited access privileges). The commands in this directory are essential to the operation of a Linux system. Some of the commands in the
bindirectory are bash, ls, cp, and cat.bootInnehåller filerna som behövs för startprocessen. I fallet för Kubuntu, innehåller det filerna för starthanteraren GRUB, startsektor, katalogfiler och Linux kärnan.
cdromA symlink or “symbolic link” to
/media/cdrom, which itself is a symlink to/media/cdrom0. If a CD is placed into the CDROM drive, the contents of that CD will be available in/media/cdrom0directory.devLocation of special or device files. For example,
/dev/sda0is the first partition on the hard drive.etcInnehåller systemrelaterade konfigurationsfiler som används till att kontrollera funktionerna i programmen.
homeInnehåller en hemkatalog för varje användare på systemet. En användares hemkatalog kan innehålla personliga konfigurationsfiler och filer som dokument, musik, film och andra av användaren skapade kataloger och filer.
initrd.imgA symlink to
/boot/initrd.img-<kernel version>which is required for system startup.libContains the kernel modules in addition to shared library images needed to boot the system and run commands.
lib32Samma som
libovan, men innehåller enbart 32-bitars versioner.lib64Samma som
libovan, men innehåller enbart 64-bitars versioner.lost+foundContains the results of any recovery operation due to an improper shutdown of the system or a system crash.
mediaContains the subdirectories which are used as mount points for removable media such as CDROM drives, USB disks, floppy disks.
mntGeneric mount point for filesystems or devices. In most cases,
/mediais where most devices will be automounted.optShort for “optional”. This directory is used for add-on packages that are typically installed manually by the user.
procVirtual filesystem that contains runtime system information which is presented in a file-like structure.
rootThe home directory of the system administrator known as “root”.
sbinContains programs that are essential to the working of the system, such as fdisk, ifconfig, reboot, and shutdown.
selinuxA pseudo-filesystem containing the commands used by the kernel subsystem for the Security-Enhanced Linux feature.
srvContains site-specific data which is served by the system.
sysContains the Linux kernel, firmware and system-related files.
tmpContains files that are required temporarily. Many programs use this directory to create lock files and for temporary storage of data.
usrContains the largest share of data on the system, including read-only user data, as well as files and programs and such as program binaries, documentation, libraries, header files, and more.
varContains variable data such as system log files, mail and printer spool directories, as well as transient and temporary files.
vmlinuzA symlink to a compressed executable of the Linux kernel.