Linux command to view system hardware information

Linux command to view system hardware information   

 

system and hardware 

 

# cat /etc/redhat-release //View operating system version (redhat and centos) 

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

# lsb_release -a //OS version 

# uname -a // view kernel/hostname and other info 

# dmesg | head -n 1 //Linux kernel and other information 

# cat /proc/version //same as above 

# dmidecode //Motherboard information 

# hostname //View computer name 

# lspci -tv //Display bus device information 

# lsusb -tv //Display USB devices 

# cat /proc/cpuinfo //View CPU related parameters 

# cat /proc/meminfo //View memory information 

# cat /proc/ioports //View device io ports 

# cat /proc/partitions //View hard disks and partitions 

# cat /proc/interrupts //View interrupts 

# cat /proc/swaps //View the information of all swap partitions

 

resource 

 

# 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 

# uptime // View system running time, number of users, load 

# cat /proc/loadavg // View system load 

# vmstat // View detailed system running information 

# env // View environment variable resources 

# lsmod // List loaded kernel modules 

# grep MemTotal /proc/meminfo // View total memory 

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

 

 

Disks and Partitions 

 

# fdisk -l // view all partitions 

# swapon -s // view all swap partitions 

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

# dmesg | grep IDE // View IDE device detection status at startup 

# mount | column -t // View the mounted partition status  

 

 

The internet 

 

# 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  

 

process 

 

# ps -ef // view all processes 

# top // Display process status in real time  

 

user 

 

# w // View logged in users and operations 

# who // show logged in users 

# whoami // View current user 

# id username // View the specified user information 

# last // View user login log 

# cut -d: -f 1 /etc/passwd // View all users of the system 

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326446416&siteId=291194637