LINUX View Hardware Configuration Commands

  

System

# uname -a # View Kernel/Operating System/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 loaded kernel modules # env # View environment variables

Resources

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

disk And partition

# mount |  Column -t # View the mounted partition status # 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

Network

# ifconfig # View all network interface properties # 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 #实时显示过程状态

User

# w # View active user # id <username> # View specified user information # last # View user login log # cut -d: - F1 /etc/passwd # View all users of the system # cut -d: -f1 /etc/group # View all groups in the system # crontab -l # View the current user's scheduled tasks

Services

# chkconfig --list # List all system services # chkconfig --list |  Grep on # List all started system services

Programs

# rpm -qa # View all installed packages

Other common commands are organized as follows:

View the serial number of the motherboard: dmidecode |  Grep -i 'serial number' Use the hardware detection program kuduz to detect new hardware: 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 board information: cat /proc/pci View video/sound card information: lspci | Grep -i 'VGA'[dmesg |  Grep -i 'VGA'] View network card 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 View keyboard and mouse: cat /proc/bus/input/devices View system hard disk information and usage: fdisk & disk – l & df View interrupt requests (IRQ) for each device: cat /proc/interrupts View system architecture: uname -a View and boot the system 32-bit or 64 Bit kernel mode: isalist –v [isainfo –v][isainfo –b] View hardware information, including bios, cpu, memory, etc.: dmidecode Determines the current display refresh rate: /usr/sbin/ffbconfig –rev View system configuration: /usr/platform/sun4u/sbin/prtdiag –v View the patches that have been applied to the current system: showrev –p Display the current runlevel: who –rH View the current bind version information: nslookup –class=chaos –q=txt version.bind View hardware information: dmesg |  More Display peripheral information, such as usb, network card, etc.: lspci View loaded drivers:

lsnod lshw

View current processor type and speed (main frequency): psrinfo -v Print the current OBP version number: prtconf -v View the hard disk physical information (vendor, RPM, Capacity): iostat – E View the disk geometry and partition information: prtvtoc /dev/rdsk/c0t0d0s shows the used and unused i -node number:

df –F ufs –oi isalist –v

For files in "/proc”, you can use the file view command to browse its contents, including 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 Version Information: Version< Br>

Remarks: proc – process information pseud O-filesystem process information camouflage file system

Copyright © Windows knowledge All Rights Reserved