Slackware Linux Basics - Huihoo
Slackware Linux Basics - Huihoo
Slackware Linux Basics - Huihoo
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chapter 4. General concepts 17<br />
administrator to connect a device to any directory in the filesystem structure. This process is named mounting. For<br />
example, one could mount the CD-ROM drive to the /cdrom directory. If the mount is correct, the files on the CD-<br />
ROM can be accessed through this directory. The mounting process is described in detail in Section 8.8, “Mounting<br />
filesystems”.<br />
Common directories<br />
The Filesystem Hierarchy Standard Group has attempted to create a standard that describes which directories should be<br />
available on a GNU/<strong>Linux</strong> system. Currently, most major distributions use the Filesystem Hierarchy Standard (FHS)<br />
as a guideline. This section describes some mandatory directories on GNU/<strong>Linux</strong> systems.<br />
Please note that GNU/<strong>Linux</strong> does not have a separate directory for each application (like Windows). Instead, files are<br />
ordered by function and type. For example, the binaries for most common user programs are stored in /usr/bin,<br />
and their libraries in /usr/lib. This is a short overview of the important directories on a <strong>Slackware</strong> <strong>Linux</strong> system:<br />
• /bin: essential user binaries that should still be available in case the /usr is not mounted.<br />
• /dev: device files. These are special files used to access certain devices.<br />
• /etc: the /etc directory contains all important configuration files.<br />
• /home: contains home directories for individual users.<br />
• /lib: essential system libraries (like glibc), and kernel modules.<br />
• /root: home directory for the root user.<br />
• /sbin: essential binaries that are used for system administration.<br />
• /tmp: a world-writable directory for temporary files.<br />
• /usr/bin: stores the majority of the user binaries.<br />
• /usr/lib: libraries that are not essential for the system to boot.<br />
• /usr/sbin: nonessential system administration binaries.<br />
• /var: variable data files, like logs.<br />
4.3. Devices<br />
Introduction<br />
In GNU/<strong>Linux</strong> virtually everything is represented as a file, including devices. Every GNU/<strong>Linux</strong> system has a directory<br />
with special files, named /dev. Each file in the /dev directory represents a device or pseudo-device. A device file<br />
has two special numbers associated with it, the major and the minor device number. The kernel knows which device<br />
a device file represents by these device numbers. The following example shows the device numbers for the /dev/<br />
zero device file:<br />
$ file /dev/zero<br />
/dev/zero: character special (1/5)<br />
The file command can be used to determine the type of a file. This particular file is recognized as a device file that<br />
has 1 as the major device number, and 5 as the minor device number.<br />
17