Learning About Your Hardware

The most common use of/proc is to obtain information about your computer. You can do this by reading the contents of/proc pseudo-files, typically by using cat or less to view them. For instance, to find information on your kernel, you could type the following command:

$ cat /proc/version

Linux version 2.4.19 ([email protected]) (gcc version 3.2 20020903

This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to regist* *(Red Hat Linux 8.0 3.2-7)) #3 Sun Nov 24 14:22:16 EST 2002

Although some files in /proc are intended for human consumption, others aren't—or at least, you need specialized skills to interpret the output. Various utilities, such as fdisk, free, ps, and netstat, help interpret/proc contents. These tools are described in the appropriate sections of this book. In some cases, other chapters also refer to specific /proc files and their contents.

Some /proc directories contain quite a maze of subdirectories. The ide, scsi, and asound subdirectories spring to mind as examples. Locating the correct file within these subdirectories can be a challenge, but most of the files and subdirectories are named in clearways. For instance, /proc/ide/ideO/hda/model holds information on the manufacturer name and model number of the first EIDE hard disk. The ideO subdirectory refers to the first EIDE channel, and hda is the Linux identifier for the first disk on this channel.

0 0

Post a comment