Useful Hardware commands

Are there any other useful hardware commands to get information about your hardware? Is there any information that can't be found with these commands?

cat /proc/cpuinfo
cat /proc/meminfo
dmesg
lspci
sudo dmidecode
cpuid | more
lspci -v | grep VGA
sudo lspci -v -s 00:02.0
sudo lspci -vvv -s 00:02.0

Updating my list a little bit.

cat /proc/cpuinfo
cat /proc/meminfo
dmesg
free
top
lspci
sudo dmidecode
cpuid | more
lspci -v | grep VGA
sudo lspci -v -s 00:02.0
sudo lspci -vvv -s 00:02.0

HowTo: Check Ram Size From Redhat Linux Desktop System

1 Like

I have already bookmark this forum due to its interesting features,

---------- Post updated at 07:17 AM ---------- Previous update was at 07:17 AM ----------

Thanks for this efforts you made.I really appreciate it.

sudo dmidecode | more

lshw -short

lspci -vv

In FreeBSD the vast majority can be found with the following commands:

sysctl
dmesg
uname
1 Like

Very few people have lshw. lshw probably uses things listed in this thread anyhow.

3 more tools for linux:

lsusb # List USB devices and hubs attached
mii-tool # Tool for configuring older ethernet cards speed/duplex/etc
ethtool # Tool for configufing newer ethernet cards speed/duplex/etc
1 Like

Another file that's sometimes useful (RedHat, but probably any Linux):

cat /etc/sysconfig/hwconf

I don't even have /etc/sysconfig... redhat is not the universe...

Something that does exist under all (modern) Linux is the special /sys/ folder. It's a virtual folder like /proc/ which holds no real files, but there's all sorts of information buried in there.

# Mac addresses for each network interface
for D in /sys/class/net/*
do
        [ "$D" = "/sys/class/net/lo" ] && continue
        [ "$D" = "/sys/class/net/sit0" ] && continue
        printf "%s\t%s\n" "${D}" "`cat ${D}/address`"
done

# Models of disk drives on the system
for D in /sys/class/block/sd[a-z] /sys/class/block/sr[0-9] /sys/class/block/hd[a-z]
do
        [ -e "$D" ] || continue
        printf "%s\t%s\n" $D "`cat "$D"/device/model`"
done

for solaris i would add:

# prtdiag
# prtconf
# ipmitool

For HP-UX:

sysinfo.sh

A gigantic Shell script from HP support. Outputs either text format or an html tree. Only uses commands available on your system. Finds out everything worth finding out about your hardware and software installation. Finds hardware error logs you never knew you had and picks up certain security holes.
Working your way through the script is an education.

For modern Windows - a handy summary from the Command Prompt:

systeminfo | more

Another Linux utility, probably not installed by default, but very useful:

sudo powertop

an interactive command which tells you about the performance of your system with respect to electrical power use. It makes fairly intelligent suggestions for reducing power use by suggesting kernel options and tweaks. It also shows a top-like list of processes and kernel drivers, ordered by how many wakeups they cause per second. Programs or drivers which poll for events instead of simply waiting will show as the power-wasters they are.

---------- Post updated 12-13-11 at 09:03 AM ---------- Previous update was 12-12-11 at 12:57 PM ----------

Another basic linux one, cat /proc/swaps

What version of redhat do you have? I have fedora and I don't have that file.

$ ls -l /etc/sysconfig/
total 216
-rw-r--r--  1 root root    9 Jan  2 09:13 acpid
-rw-r--r--. 1 root root  403 Jul 20  2011 atd
-rw-r-----. 1 root root  647 Aug 15  2011 auditd
-rw-r--r--. 1 root root  368 Sep 12  2011 authconfig
drwxr-xr-x. 2 root root 4096 Jan  8 22:13 cbq
-rw-r--r--. 1 root root  486 May 30  2011 cgconfig
-rw-r--r--. 1 root root  950 May 30  2011 cgred.conf
-rw-rw-r--. 1 root root  199 Sep 12  2011 clock
drwxr-xr-x. 2 root root 4096 Oct 12 16:46 console
-rw-r--r--. 1 root root 2651 Feb  8  2011 cpuspeed
-rw-r--r--. 1 root root  110 Oct 25 16:39 crond
-rw-rw-r--. 1 root root   35 May 13  2011 desktop
-rw-r--r--. 1 root root   31 Jun 28  2011 dund
-rw-r--r--. 1 root root   17 Sep 12  2011 firstboot
-rw-r--r--. 1 root root   35 Feb  9  2011 gpsd
-rw-rw-r--. 1 root root   25 Sep 12  2011 grub
-rw-r--r--  1 root root  830 Feb 13 09:46 httpd
-rw-rw-r--. 1 root root   47 Sep 12  2011 i18n
-rw-r--r--. 1 root root 1070 Oct 12 16:46 init
-rw-------. 1 root root  416 May 13  2011 ip6tables
-rw-------. 1 root root 1753 Feb 14  2011 ip6tables-config
-rw-------. 1 root root  495 May 13  2011 ip6tables.old
-rw-------. 1 root root  420 Dec 21 05:54 iptables
-rw-------. 1 root root 1740 Feb 14  2011 iptables-config
-rw-------. 1 root root  493 May 13  2011 iptables.old
-rw-------. 1 root root  411 Dec 21 05:54 iptables.save
-rw-r--r--. 1 root root   58 Jul 15  2011 irda
-rw-r--r--. 1 root root  648 May  6  2011 irqbalance
-rw-rw-r--  1 root root  180 Mar  9 02:49 kernel
-rw-rw-r--. 1 root root   45 Sep 12  2011 keyboard
-rw-r--r--. 1 root root  204 Jun 17  2011 man-db
drwxr-xr-x. 2 root root 4096 Oct 12 16:46 modules
-rw-r--r--. 1 root root  634 Oct 12 16:46 netconsole
-rw-rw-r--. 1 root root   76 Oct 24 21:00 network
drwxr-xr-x. 4 root root 4096 Oct 12 16:46 networking
drwxr-xr-x. 2 root root 4096 Mar  2 18:47 network-scripts
-rw-r--r--. 1 root root 1737 Sep 14  2011 nfs
-rw-r--r--. 1 root root   45 May  6  2011 ntpd
-rw-r--r--. 1 root root  159 May  6  2011 ntpdate
-rw-r--r--. 1 root root   71 Jun 28  2011 pand
-rw-r--r--. 1 root root 1459 Apr  1  2011 prelink
-rw-r--r--  1 root root 2776 Jan 12 08:01 raid-check
-rw-r--r--. 1 root root   15 Feb  9  2011 rdisc
-rw-r--r--. 1 root root  659 Oct 12 16:46 readonly-root
-rw-r--r--  1 root root  200 Jan 27 07:56 rsyslog
-rw-r--r--. 1 root root  136 Apr 29  2011 sandbox
-rw-r--r--. 1 root root  553 Jul 26  2011 saslauthd
lrwxrwxrwx. 1 root root   17 May 13  2011 selinux -> ../selinux/config
-rw-r--r--. 1 root root   20 Oct 24 08:28 sendmail
-rw-r--r--. 1 root root  125 Oct 21 09:34 smartmontools
-rw-------. 1 root root   71 Sep 12  2011 system-config-firewall
-rw-------. 1 root root   74 May 13  2011 system-config-firewall.old
-rw-r--r--. 1 root root  304 Aug 23  2011 system-config-users
-rw-r--r--. 1 root root  644 Jul 27  2011 wpa_supplicant
-rw-r--r--. 1 root root  376 Apr 21  2011 xinetd

Might be a RHEL-only thing (5.4). :o