How to find hardware information from command line on Linux

linux

linux

Hi

In this post you can see some useful command to find and show hardware information on Linux.

Default commands

ALL devices

dmesg

dmesg will show you the kernel messages which can show you all the devices the kernel has found (hard disks,cdroms,etc)

CPU

# cat /proc/cpuinfo

Memory

# cat /proc/meminfo
$ free

PCI (including usb bridges,agp cards etc)

$ lspci

USB devices (mice,etc)

$ lsusb

Hard drives

# fdisk -l
$ df -h

Additional Command

lshw

lshw is a Linux command which provides details of all the hardware in your PC. The details provided by the lshw command run the gamut of processors, memory, slots, onboard sound, video chipset and more.

Install lshw

Arch:

# pacman -S lshw

Debain, Ubuntu or any of its derivatives:

$ sudo aptitude install lshw

Redhat, fedora, CentOS:

# yum install lshw

Gentoo:

# emerge lshw
Run lshw
# lshw
# lshw -short

To get the output in HTML, you use the -html option as follows:

# lshw -html > hardware-info.html

• See lshw command – List hardware information in Linux

dmidecode

dmidecode command reads the system DMI table to display hardware and BIOS information of the server. Apart from getting current configuration of the system, you can also get information about maximum supported configuration of the system using dmidecode. For example, dmidecode gives both the current RAM on the system and the maximum RAM supported by the system.
dmidecode is installed by default on many linux distribution like debain, ubuntu and fedora.
• See How To Get Hardware Information On Linux Using dmidecode Command

have a good time :)

  • Share/Bookmark

What's dpkg-reconfigure

Reconfigure an already installed package like gdm.

dpkg-reconfigure package_name

For example you can reconfigure X Server:

sudo dpkg-reconfigure xserver-xorg
  • Share/Bookmark

Root Terminal in Ubuntu

terminal_icon_48_48.jpg
Hi
Ubuntu has the root account disabled.
You use sudo to run commands as root. if you need root access for some work:

  • To start a root shell, but keep the current shell’s environment, use:
    sudo -s
  • To start a root shell (i.e. a command window where you can run root commands), starting root’s environment and login scripts, use:
    sudo -i

There is also a root terminal that is in the Applications menu. You have to right-click to edit the menu’s and add a check to the root terminal in System Tools items.

Don’t forget to type ‘exit’ (or press Ctrl+D) to switch back to your normal user when you are done.

More information about sudo in Ubuntu wiki

  • Share/Bookmark