Linux Server Comand Check
Transcript of Linux Server Comand Check
-
8/2/2019 Linux Server Comand Check
1/5
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
-
8/2/2019 Linux Server Comand Check
2/5
# 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
-
8/2/2019 Linux Server Comand Check
3/5
# 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 xcdroast
# See current environment list, or pipe to file
env | more
env > environmentvariablelist.txt
# Show current userid and assigned groups
-
8/2/2019 Linux Server Comand Check
4/5
id
# See all command aliases for the current user
alias
# See rpms installed on current system
rpmquery --all | less
rpmquery --all >
rpmquery --all | grep -i
Autospec for tarballs
RPM tools
# What directory am I using
pwd
# Get ls colors in less
ls --color=always | lessR
-
8/2/2019 Linux Server Comand Check
5/5
cat /proc/cpuinfo | Informasi Processor
# cat /proc/meminfo | Informasi Memory
# lshw | Untuk list perangkat keras
# fdisk -l | Informasi Harddisk dan partisi
# lspci | Informasi lengkap jenis Controller, BUS, PCI, dll
# lspci -nn | Informasi singkat jenis Controller, BUS, PCI, dll
# lspci | grep VGA | Informasi VGA / Display Card
# lspci | grep Eth | Informasi Ethernet Card / NIC / LAN Card
# uname -a | Informasi Kernel dan jenis Processor