Page 1 of 1

Finding/Checking hardware

Posted: 23 Apr 2010, 00:41
by viking60
Here are a few commands that will help you find out the hardware on your box:

UNIVERSAL
# Find CPU specifications
cat /proc/cpuinfo

# Find running kernel version
uname -r

# What directory am I using
pwd

# Get ls colors in less
ls --color=always|less -R[/col]

# 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 Output will look something like this
X.Org X Server 1.7.6
Release Date: 2010-03-17
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.33-ARCH x86_64
Current Operating System: Linux thomas-laptop 2.6.33-ARCH #1 SMP PREEMPT Sun Apr 4 10:27:30 CEST 2010 x86_64
Kernel command line: root=/dev/disk/by-uuid/b09482df-3276-4369-ab81-9f0e2194de2f ro
Build Date: 01 April 2010 05:28:33PM

Current version of pixman: 0.18.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.



# What kernel modules are loaded
lsmod

# Memory and swap information
cat /proc/meminfo
free


# How are the hard drives partitioned
su
fdisk -l

# How much free/used drive space
df -h

# Show disk usage by current directory and all subdirectories

Code: Select all

du|less


# What takes up so much space on your box
# Run from the directory in question and the largest chunk shows up last

Code: Select all

su
password
find $1 -type d|xargs du -sm | sort -g



# For finding or locating files
whereis example:
[thomas@thomas-pc ~]$ whereis bluefish
bluefish: /usr/bin/bluefish /usr/lib64/bluefish /usr/share/bluefish


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

Code: Select all

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

Code: Select all

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

Re: Finding/Checking hardware

Posted: 23 Apr 2010, 01:11
by dedanna1029
Must be careful boss - some of that is rpm-agnostic. What about commands for either other types of file systems, or that are universal for all?

Re: Finding/Checking hardware

Posted: 23 Apr 2010, 01:20
by viking60
Well I have tested most of them on both Arch and Mandriva. Sure all of them wont work on both systems (if it has rpm in its name it is clear!) but feel free to organize them.
And I forgot; procinfo is nice it is not installed by default in Mandriva.
What commands do you have in mind that are unknown to Mandriva? It is ok to divide in universal and special no protest on that.
Edit:
I have organized them now. I am looking forward to your list where you show how it is done (take your time in 15 minutes will do):mrgreen:

Re: Finding/Checking hardware

Posted: 23 Apr 2010, 02:08
by dedanna1029
My main point is that rpm commands aren't going to do a .deb or tar.gz or other file system user a bit of good. We need to stay general, as it was assumed your post was meant to be. If we're going to support other distributions/file systems, then we need to keep things general/universal.

When I need commands, whatever distro I'm on, I go to http://ss64.com/bash/ - that's my cheat sheet. :) It's not often that I need it, though.