Classification commands: 1.1, System
# 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
1.2. 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
1.3. 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
1.4. Network
# 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
1.5. Process
# ps-ef # View All Processes
# top # Real-time display of process status
1.6. Users
# 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
1.7. Service
# chkconfig--list # list all system services
# chkconfig--list | grep on # Lists all startup system services
1.8. Procedure
# rpm-qa # View all installed Packages
2, commonly used command collation as follows:
2.1. Check the serial number of the motherboard: Dmidecode | Grep-i ' Serial number '
2.2. Detecting new hardware with hardware detection program Kuduz: Service kudzu start (or restart)
2.3. View CPU information: Cat/proc/cpuinfo [DMESG | grep-i ' CPU '][DMIDECODE-T processor]
2.4. View memory information: Cat/proc/meminfo [Free-m][vmstat]
2.5. View board Information: CAT/PROC/PCI
2.6. View video card/sound card information: Lspci |grep-i ' VGA ' [DMESG | grep-i ' VGA ']
2.7. View network card information: DMESG | Grep-i ' ETH ' [cat/etc/sysconfig/hwconf | grep-i eth][lspci | grep-i ' ETH ']
2.8. View PCI Information: LSPCI (more intuitive than CAT/PROC/PCI)
2.9. View USB Device: Cat/proc/bus/usb/devices
2.10. View keyboard and mouse: Cat/proc/bus/input/devices
2.11. View system hard disk information and usage: Fdisk & disk–l & DF
2.12. View Interrupt Request (IRQ) for each device: cat/proc/interrupts
2.13. View System Architecture: UNAME-A
2.14. View and start the system's 32-bit or 64-bit kernel mode: isalist–v [isainfo–v][isainfo–b]
2.15, check the hardware information, including BIOS, CPU, memory and other information Dmidecode
2.16, determine the current display refresh frequency:/usr/sbin/ffbconfig–rev \?
2.17. View System Configuration:/usr/platform/sun4u/sbin/prtdiag–v
2.18. View the patches already applied in the current system: showrev–p
2.19, display the current operating level: WHO–RH
2.20. View current BIND version information: Nslookup–class=chaos–q=txt Version.bind
2.21. View hardware information: DMESG | More
2.22, display peripheral information, such as USB, network card and other information: LSPCI
2.23. View loaded drivers: Lsnod
Lshw
2.24, check the current processor type and speed (frequency): Psrinfo-v
2.25. Print the current OBP version number: Prtconf-v
2.26. View hard disk physical information (vendor, RPM, capacity): Iostat–e
2.27. View disk geometry and partition information: prtvtoc/dev/rdsk/c0t0d0s
2.28. Shows the number of i-node used and unused: df–f ufs–o I
Isalist–v
2.29, for the "/proc" file can use the File View command to browse its content, the file contains system-specific information:
Cpuinfo Host CPU Information
DMA Host DMA Channel information
Filesystems File System Information
Interrupts host interrupt Information
Ioprots host I/O port number information
Meninfo Host Memory Information
Version Linux memory release information
Note: proc–process information Pseudo-filesystem process information masquerading file system
Hardware information for Linux system servers
3.1. View Machine model
suse:~ # Dmidecode | grep "Product Name"
Product NAME:IBM System x3650-[7979fjl]-
Product Name:system Planar
Product Name:power suppy Backplane
Product name:pci-express Riser Card, Slots 1 & 2
Explanation: The server model can be obtained by this command: IBM System x3650-[7979fjl]-
3.2. View the kernel version of the Linux system
suse:~ # Cat/proc/version
Linux version 2.6.32.12-0.7-default ([email protected]) (gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux)) #1 SMP 2010-05-20 11:14:20 +0200
Explanation: Version number of the Linux kernel in this server: 2.6.32
Version number of the compiler gcc: 4.3.4
3.3. View motherboard information
suse:~ # Dmidecode | Grep-i ' Serial number '
Serial number:99fn644
Serial Number:not Specified
Explanation: The server's board number is: 99fn644
3.4. View CPU Information
suse:~ # cat/proc/cpuinfo |grep Name
Model Name:intel (R) Xeon (r) CPU X5450 @ 3.00GHz
Model Name:intel (R) Xeon (r) CPU X5450 @ 3.00GHz
Model Name:intel (R) Xeon (r) CPU X5450 @ 3.00GHz
Model Name:intel (R) Xeon (r) CPU X5450 @ 3.00GHz
Model Name:intel (R) Xeon (r) CPU X5450 @ 3.00GHz
Model Name:intel (R) Xeon (r) CPU X5450 @ 3.00GHz
Model Name:intel (R) Xeon (r) CPU X5450 @ 3.00GHz
Model Name:intel (R) Xeon (r) CPU X5450 @ 3.00GHz
suse:~ # Cat/proc/cpuinfo | grep Physical | Uniq-c
1 Physical id:0
1 Address sizes:38 bits physical, bits virtual
1 Physical id:0
1 Address sizes:38 bits physical, bits virtual
1 Physical id:0
1 Address sizes:38 bits physical, bits virtual
1 Physical id:0
1 Address sizes:38 bits physical, bits virtual
1 Physical id:1
1 Address sizes:38 bits physical, bits virtual
1 Physical id:1
1 Address sizes:38 bits physical, bits virtual
1 Physical id:1
1 Address sizes:38 bits physical, bits virtual
1 Physical id:1
1 Address sizes:38 bits physical, bits virtual
suse:~ # getconf Long_bit
64
Explanation: The CPU used by the server is the Intel (r) Xeon (r) CPU, the model is X5450, there are 8 logical CPUs, two physically, each of which is a quad-core CPU, the current CPU is working in 64-bit mode.
3.5. View memory Information
suse:~ # Free-m
Total used free shared buffers Cached
mem:7875 904 6971 0 199 390
-/+ buffers/cache:314 7561
swap:12001 0 12001
Explanation: The total memory capacity of the server is 7875Mb (about 8Gb), has used 904Mb, and the remaining 6971Mb space, the cache space has been used 314Mb, but also the remaining 7561Mb. The server has a total virtual memory capacity of 12001Mb (12GB), which is not currently in use.
3.6. View hard Drive information
suse:~ # Df-h
File system capacity has been used with available% mount points
/DEV/SDA1 123G 4.9G 112G 5%/
Devtmpfs 3.9G 76K 3.9G 1%/dev
Tmpfs 3.9G 88K 3.9G 1%/DEV/SHM
suse:~ # Fdisk-l
disk/dev/sda:146.7 GB, 146685296640 bytes
255 heads, Sectors/track, 17833 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Disk IDENTIFIER:0X0002F4FD
Device Boot Start End Blocks Id System
/DEV/SDA1 * 1531 17833 130953847+ Linux
/dev/sda2 1 1530 12289693+ for Linux Swap/solaris
Partition table entries is not in disk order
Explanation: The server's hard disk interface is SCSI type, the total disk capacity of about 150Gb, a total of two partitions, the first partition capacity of about 140GB, has used the size of 5Gb, the second partition as a virtual file use.
3.7. View network card information
suse:~ # DMESG | Grep-i ' ETH '
[13.789383] Broadcom netxtreme II Gigabit Ethernet Driver bnx2 v2.0.4 (Mar 03, 2010)
[13.966469] eth0:broadcom netxtreme II BCM5708 1000base-t (B2) pci-x 64-bit 133MHz found at Mem ce000000, IRQ +, node Addr 00:1a:64:ca:d5:f8
[13.974877] eth1:broadcom netxtreme II BCM5708 1000base-t (B2) pci-x 64-bit 133MHz found at Mem ca000000, IRQ, node Addr 00:1a:64:ca:d5:fa
[20.569505] bnx2:eth1:using MSI
[22.169117] bnx2:eth1 NIC Copper Link is up, at Mbps full duplex
Explanation: The server uses two network cards, the model is Netxtrme II BCM5708 1000base-t (B2), are 64-bit, the first network card IP address is: 00:1A:64:CA:D5:F8, the second network card IP address is: 00:1a:64: Ca:d5:fa.
3.8. View video card information
suse:~ # DMESG | Grep-i ' VGA '
[0.000000] Command line:root=/dev/disk/by-id/scsi-sservera_vol_7c8a7bca-part1 Resume=/dev/disk/by-id/ Scsi-sservera_vol_7c8a7bca-part2 splash=silent crashkernel=256m-:128m vga=0x314
[0.000000] Kernel command Line:root=/dev/disk/by-id/scsi-sservera_vol_7c8a7bca-part1 Resume=/dev/disk/by-id/ Scsi-sservera_vol_7c8a7bca-part2 splash=silent crashkernel=256m-:128m vga=0x314
[0.845698] Vgaarb:device Added:pci:0000:01:06.0,decodes=io+mem,owns=io+mem,locks=none
[0.845701] Vgaarb:loaded
[1.095862] Fb0:vesa VGA frame buffer device
Explanation: The server uses a dual graphics card, it can clearly use the CPU to provide data processing to become acceptable text or image display.
4.9. View current operating System Information
suse:~ # Uname-a
Linux SUSE 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64
x86_64 Gnu/linux
Explanation: The operating system currently used by this server is Linux SUSE 2.6.32.12
Linux system-related, hardware, resources-related commands