Finding/Checking hardware
Posted: 23 Apr 2010, 00:41
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
# 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
# What takes up so much space on your box
# Run from the directory in question and the largest chunk shows up last
# For finding or locating files
whereis example:
# Use dmesg to view the kernel ring buffer (error messages)
# 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
# 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
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
# 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:
# 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