Transferred from: http://blog.chinaunix.net/uid-20321537-id-3494700.html
# uname-a # View kernel/Os/cpu information
# head-n 1/etc/issue # view OS version
# cat/proc/cpuinfo # View CPU Information
# hostname # View computer name
# LSPCI-TV # list all PCI devices
# LSUSB-TV # list all USB devices
# lsmod # List of loaded kernel modules
# env # View Environment variables
Resources
# free-m # View memory usage and swap area 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 # View System uptime, number of users, load
# cat/proc/loadavg # View System load
Disks and partitions
# Mount | COLUMN-T # Viewing the status of a mounted partition
# fdisk-l # View all partitions
# swapon-s # View all swap partitions
# hdparm-i/dev/hda # View disk parameters (for IDE devices only)
# DMESG | grep IDE # View IDE device detection status at startup
Internet
# ifconfig # View the properties of all network interfaces
# iptables-l # View firewall settings
# route-n # View the 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 # Real-time display of process status
User
# w # View active Users
# ID < user name > # view specified user information
# last # View user log in log
# cut-d:-f1/etc/passwd # View All users of the system
# cut-d:-f1/etc/group # View all system groups
# crontab-l # View Current user's scheduled tasks
Service
# chkconfig--list # list all system services
# chkconfig--list | grep on # Lists all startup system services
Program
# rpm-qa # View all installed Packages
Other commonly used commands are organized as follows:
View the serial number of the motherboard: Dmidecode | Grep-i ' Serial number '
Detecting new hardware with hardware detection program Kuduz: Service kudzu start (or restart)
View CPU information: Cat/proc/cpuinfo [DMESG | grep-i ' CPU '][DMIDECODE-T processor]
View memory information: Cat/proc/meminfo [Free-m][vmstat]
View card information: CAT/PROC/PCI
View video card/sound card information: Lspci |grep-i ' VGA ' [DMESG | grep-i ' VGA ']
View nic Information: DMESG | Grep-i ' ETH ' [cat/etc/sysconfig/hwconf | grep-i eth][lspci | grep-i ' ETH ']
View PCI information: LSPCI (more intuitive than CAT/PROC/PCI)
View USB devices: Cat/proc/bus/usb/devices
Viewing the keyboard and mouse: Cat/proc/bus/input/devices
View system hard disk information and usage: Fdisk & disk–l & DF
To view interrupt requests (IRQ) for each device: cat/proc/interrupts
View System Architecture: UNAME-A
View and start the system's 32-bit or 64-bit kernel mode: isalist–v [isainfo–v][isainfo–b]
View hardware information, including BIOS, CPU, memory, and more: Dmidecode
Determine the current display refresh rate:/usr/sbin/ffbconfig–rev \?
View System configuration:/usr/platform/sun4u/sbin/prtdiag–v
To view patches already applied in the current system: showrev–p
Displays the current runlevel: WHO–RH
View current BIND version information: Nslookup–class=chaos–q=txt Version.bind
View hardware information: DMESG | More
Display peripheral information, such as USB, NIC, etc.: LSPCI
To view the loaded drivers:
Lsnod
Lshw
To view the current processor type and speed (frequency): Psrinfo-v
Print the current OBP version number: Prtconf-v
View hard disk physical information (vendor, RPM, capacity): Iostat–e
To view the geometry parameters and partition information for a disk: prtvtoc/dev/rdsk/c0t0d0s
Shows the number of i-node that have been used and not used:
Df–f Ufs–o I
Isalist–v
For files in "/proc", you can use the File View command to browse its contents, and the file contains system-specific information:
Host CPU Information: Cpuinfo
Host DMA Channel information: DMA
File System Information: filesystems
Host Interrupt information: interrupts
Host I/O port number information: Ioprots
Host Memory Information: Meninfo
Linux Memory release information: version
Note: proc–process information Pseudo-filesystem process information masquerading file system
Linux View hardware configuration commands