All you ever wanted to know about bash but were afraid to ask...
What's all this bash command stuff mean?
# Bash shell commands
Command Reference NHF
O'Reilly Directory of Linux Commands
# Handy bash commands I might use or ask a newbie to use:
# Find CPU specifications
cat /proc/cpuinfo
# Find running kernel version
uname -r
# What modules are loaded
cat /proc/modules
/sbin/lsmod
# 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
# What drives are mounted
mount
# How much used drive space in a directory
du -sh /path/to/directory
# Show disk usage by current directory and all subdirectories
du | less
# 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 (updatedb needs to be run first)
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 redirect 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
BASH Programming - Introduction HOW-TO
Advanced Bash-Scripting Guide