Switching between open source OSs can sometimes be confusing, since they may have different ways of doing things. A common task that may confuse some users when switching systems is getting hardware information. In the case of Linux-based OSs and FreeBSD, the following cheat sheet for figuring out how to do the same things on two different systems can ease some of the pain.
CPU and memory information
Because Linux-based systems use the
proc device filesystem to provide access to information about hardware devices in the system, getting specific information about the hardware sometimes involves finding it in files using the
grep command. The same information is normally accessed on FreeBSD via the
To get information about your CPU model . . .
grep model /proc/cpuinfo
To get information about total system memory . . .
grep MemTotal /proc/meminfo
Information about many other devices might be needed as well. For these, each system has tools designed to provide listings of devices connected to various system buses.
To get information about PCI devices . . .
To get information about USB devices . . .
To get other connected device information . . .
This command shows DMI/SMBIOS hardware information.
This command shows all devices managed by the HAL subsystem.
This command shows all ATA devices.
camcontrol devlist -v
Some of the above commands may work from a normal, unprivileged user account. Others may be restricted to root access.
On both of these OS types, a lot more information can be had by means similar to those described above. For instance, the
/proc/meminfo files contain a lot more information than just the CPU model and total memory. There is a
sysctl command on Linux-based systems as well as on FreeBSD and other BSD Unix systems, but it is not as broadly useful as on FreeBSD, nor does it offer as comprehensive coverage of the system, because Linux-based systems default to other means of accessing and configuring system configuration values (such as the
proc filesystem). On either system type, a picture of
sysctl capabilities can be seen by viewing the utility's manpage.
If you are feeling curious and have some time to spend exploring,
sysctl -a outputs all information
sysctl has to provide.
Chad Perrin is an IT consultant, developer, and freelance professional writer. He holds both Microsoft and CompTIA certifications and is a graduate of two IT industry trade schools.