Linux view system configuration commands in detail

  • 2020-06-23 02:30:39
  • OfStack

This article shares common Linux configuration commands for your reference, the specific content is as follows

system


# uname -a        #  Check the kernel / The operating system /CPU information 
# head -n 1 /etc/issue  #  View the operating system version 
# cat /proc/cpuinfo   #  To view CPU information 
# hostname        #  View the computer name 
# lspci -tv       #  List all PCI equipment 
# lsusb -tv       #  List all USB equipment 
# lsmod         #  Lists the loaded kernel modules 
# env          #  View environment variables 

resources


# free -m        #  View memory usage and swap usage 
# df -h         #  View the usage of each partition 
# du -sh < Directory name >    #  View the size of the specified directory 
# grep MemTotal /proc/meminfo  #  View total memory 
# grep MemFree /proc/meminfo  #  View the amount of free memory 
# uptime         #  Check the system running time, number of users, load 
# cat /proc/loadavg   #  View system load 

Disk and partition


# mount | column -t   #  View the status of the pending partition 
# fdisk -l        #  View all partitions 
# swapon -s       #  View all swap partitions 
# hdparm -i /dev/hda   #  View disk parameters ( Applies only to IDE equipment )
# dmesg | grep IDE    #  View startup time IDE Equipment detection status 

network


# ifconfig        #  View the properties of all the network interfaces 
# iptables -L      #  View firewall Settings 
# route -n        #  View routing table 
# netstat -lntp     #  View all listening ports 
# netstat -antp     #  View all connections that have been established 
# netstat -s       #  View network statistics 

process


# ps -ef         #  View all processes 
# top          #  Real-time display of process status 

The user


# w           #  View active users 
# id < The user name >      #  View specified user information 
# last          #  View the user logon log 
# cut -d: -f1 /etc/passwd  #  View all users of the system 
# cut -d: -f1 /etc/group  #  View all groups of the system 
# crontab -l       #  View the scheduled tasks for the current user 

service


# chkconfig --list    #  List all system services 
# chkconfig --list | grep on  #  Lists all started system services 

The program


# rpm -qa        #  View all installed packages 

Related articles: