How to find out things in Linux with bash commands
Don't forget that re-direction and piping add to the power in bash, so some of these tips use them.
# Basic piping
some_command | another_command
See Linux and the tools philosophy
# Basic re-direction:
command > textfile_name
See this Text Manipulation Article
# Basic concantenation:
If you don't want to overwrite a file but add to the bottom of an existing file, concantenate it:
command >> exisiting_text_file
The bash commands:
# Find CPU specifications
cat /proc/cpuinfo
# What pci cards are installed and what irq/port is used
cat /proc/pci
# Memory information
free
# How is the hard drive partitioned
fdisk /dev/hdXX -l
# How much free drive space
df -h
# Show disk usage by current directory and all subdirectories
du | less
# Find running kernel version
uname -r
# Find X server version
X -showconfig
# 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
For example, XCDroast
ps -ef | grep -i xcdroast /* Case Insensitive */
# 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 | more
rpmquery --all > .txt
rpmquery --all | grep -i /* find specific rpms with name in them */
# What directory am I using
pwd
Look at man or info for the flags and options you can use for bash commands