1. System-related
| 1234567891011121314151617181920 |
uname -a 查看内核/操作系统/CPU信息head -n 1 /etc/issue查看操作系统版本cat /proc/cpuinfo查看CPU信息hostname查看计算机名lspci -tv 列出所有PCI设备lsusb -tv 列出所有USB设备lsmod 列出加载的内核模块env查看环境变量 资源free -m 查看内存使用量和交换区使用量df -h 查看各分区使用情况du -sh <目录名> 查看指定目录的大小grep MemTotal /proc/meminfo查看内存总量grep MemFree /proc/meminfo查看空闲内存量uptime 查看系统运行时间、用户数、负载cat /proc/loadavg查看系统负载 磁盘和分区mount | column -t 查看挂接的分区状态fdisk -l 查看所有分区swapon -s 查看所有交换分区hdparm -i /dev/hda查看磁盘参数(仅适用于IDE设备)dmesg | grep IDE 查看启动时IDE设备检测状况 |
2. Network-related
| 123456 |
ifconfig查看所有网络接口的属性iptables -L 查看防火墙设置route -n 查看路由表netstat -lntp 查看所有监听端口netstat -antp 查看所有已经建立的连接netstat-s 查看网络统计信息 |
3. Process-related
| 12 |
ps-ef 查看所有进程top实时显示进程状态 |
4. User-related
| 12345678 |
w View active Users id 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 the current user's scheduled tasks service chkconfig--list lists all system services chkconfig--list | grep on List all startup system Services |
Linux common View device commands