Home  >  Article  >  Operation and Maintenance  >  Summary of commonly used commands for system inspection under Linux

Summary of commonly used commands for system inspection under Linux

巴扎黑
巴扎黑Original
2017-08-22 14:21:012075browse

Linux systems require regular inspections to check the usage of server software and hardware, which is equivalent to a physical examination of a person, to ensure that problems can be discovered and solved in time, and losses can be reduced. Commonly used inspection commands are as follows:

# uname -a # View kernel/operating system/CPU information

# head -n 1 /etc/issue # View operating system version

# cat /proc/cpuinfo # View CPU information

# hostname # View the computer name

# lspci -tv # List all PCI devices

# lsusb -tv # List all USB devices

# lsmod # List loaded kernel modules

# env # View environment variables

# free -m # View memory usage and swap area usage

# df -h # Check the usage of each partition

# du -sh < directory name> # Check the size of the specified directory

# grep MemTotal /proc/meminfo # Check the total memory

# grep MemFree /proc/meminfo # Check the amount of free memory

# uptime # Check the system running time, number of users, and load

# cat /proc/loadavg # Check the system load

# mount | column -t # Check the attached partition status

# fdisk -l # Check all partitions

# swapon -s # Check all swap partitions

# hdparm -i /dev/hda # View disk parameters (only applicable to IDE devices)

# dmesg | grep IDE # View the IDE device detection status during startup

# ifconfig # View Properties of all network interfaces

# iptables -L #View firewall settings

# route -n #View routing table

# netstat -lntp #View all listening ports

# netstat -antp # View all established connections

# netstat -s # View network statistics

# ps -ef # View all processes

# top # Display process status in real time

# w # View active users

# id < username> # View specified user information

# last # View user login Log

# cut -d: -f1 /etc/passwd # View all users in the system

# cut -d: -f1 /etc/group # View all groups in the system

# crontab -l # View all users’ scheduled tasks


The above is the detailed content of Summary of commonly used commands for system inspection under Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn