LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   command to check hardware (http://www.linuxquestions.org/questions/linux-general-1/command-to-check-hardware-135433/)

harrycrumb11 01-16-2004 10:43 AM

command to check hardware
 
I'm pretty new to linux. Just wondering if there is a command for linux to print up a list of hardware specs on a computer, also giving information on if the hardware is working properly or not. I'm using Knoppix 3.3. Thanks in advance.

fancypiper 01-16-2004 11:22 AM

You mean you don't know what hardware is in your computer? Here are a few bash commands for finding out stuff.

Handy bash commands for finding out stuff in Linux:
# Find CPU specifications
cat /proc/cpuinfo

# Find running kernel version
uname -r

# What compiler version do I have installed
gcc -v
gcc --version

# What is the running kernel and compiler installed
cat /proc/version

# Find X server version
X -showconfig

# What pci cards are installed and what irq/port is used
cat /proc/pci

# What kernel modules are loaded
lsmod

# Memory and swap information
cat /proc/meminfo
free
An article: Tips for Optimizing Linux Memory

# How are the hard drives partitioned
fdisk -l

# How much free/used drive space
df -h

# Show disk usage by current directory and all subdirectories
du | less

# What takes up so much space on your box
# Run from the directory in question and the largest chunk shows up last
find $1 -type d | xargs du -sm | sort -g

# What is the distribution
cat /etc/.product
cat /etc/.issue
cat /etc/issue
cat /etc/issue.net
sysinfo

# For finding or locating files
find
locate
which
whereis

# Use dmesg to view the kernel ring buffer (error messages)
dmesg | less

# Watch error messages as they happen (sysklog needed)
as root, tail -f /var/log/messages (shows last 10 lines, use a number in front of f for more lines)

# What processes are running
ps -A

# Find a process by name
ps -ef | grep -i <plain text>
For example, XCDroast
ps -ef xcdroast

# See current environment list, or pipe to file
env | more
env > environmentvariablelist.txt

# Show current userid and assigned groups
id

# See all command aliases for the current user
alias

# See rpms installed on current system
rpmquery --all | less
rpmquery --all > <filename>
rpmquery --all | grep -i <plaintext>

Autospec for tarballs
RPM tools

# What directory am I using
pwd

# Get ls colors in less
ls --color=always | less -R

Look at man <command> or info <command> for the flags I used and for other options you can use for bash commands.

Techsystemquery 08-01-2012 12:14 PM

you can try below commands to get hardware details.
lspci
/proc
dmidecode
hwinfo

This article which I referred have linux hardware information

pixellany 08-01-2012 12:21 PM

Thanks for the great link!! I want to find the GUI version of lshw!!

Normally, it's not good to reopen (very) old threads----but I think this is an exception.

techguru666 08-03-2012 02:06 AM

Quote:

I'm pretty new to linux. Just wondering if there is a command for linux to print up a list of hardware specs on a computer, also giving information on if the hardware is working properly or not. I'm using Knoppix 3.3. Thanks in advance.
This is a nice tutorials for hardware related commands:
http://www.expertslogin.com/linux-ad...dware-details/

Habitual 08-04-2012 05:16 PM

Quote:

Originally Posted by harrycrumb11 (Post 704493)
I'm pretty new to linux. Just wondering if there is a command for linux to print up a list of hardware specs on a computer, also giving information on if the hardware is working properly or not. I'm using Knoppix 3.3. Thanks in advance.

Have a gander at http://cb.vu/unixtoolbox.xhtml

fakie_flip 11-19-2012 01:03 PM

There are a number of ways to check what hardware you have in Linux. These are all important to know when configuring a kernel from source before compiling it. I will be covering commands for finding hardware information because that's what you asked for, not information about your software like the first guy posted.

Code:

lspci
lsusb
lshw
cat /proc/cpuinfo
hwinfo
dmidecode (run as root)

There may be more that are just a google search away, and they might just give you the same info as the ones above do.

To see drivers (kernel modules) in use, use

Code:

lspci -nnk
On my machine, here is a snip of the output.

Code:

00:14.2 Audio device [0403]: ATI Technologies Inc SBx00 Azalia (Intel HDA) [1002:4383]
        Subsystem: ASUSTeK Computer Inc. Device [1043:8249]
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd-hda-intel

You can see the kernel module (driver) in use is snd-hda-intel. This is extremely useful when compiling a kernel to know what to include in your kernel config. Most everything should be compiled directly into the kernel for your specific hardware. That will result in a much faster more efficient kernel.

For a few devices that are not always in use such as my usb webcam, I left it as a module, so that it only loads when in use. This is just my preference. You can do it either way.

If you plugin hardware such as a usb device while Linux is running, information about it will show in

Code:

dmesg | tail

fakie_flip 11-19-2012 01:07 PM

Quote:

Originally Posted by pixellany (Post 4743324)
Thanks for the great link!! I want to find the GUI version of lshw!!

lshw -html > myhardware.html

Now you can open that file with a GUI such as firefox or your web browser of choice.

Techsystemquery 11-26-2013 05:25 PM

Linux hardware details
 
Sorry I mean to edit a different thread. Not sure how to delete this now :-)

Spect73 11-26-2013 07:32 PM

Quote:

Originally Posted by Techsystemquery (Post 5071080)
Sorry I mean to edit a different thread. Not sure how to delete this now :-)

Hey, I'm glad you got the wrong thread! Looking over this older stuff, I learned something new. Thanks :)

Coordially,


All times are GMT -5. The time now is 05:05 PM.