View Centos System Information Command

The inux command line has powerful functions. After we install the vps, we should first know the system information. Check this information, you will find that the Linux command is very simple, you can practice according to the following commands.

linux system information

# 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 loaded kernel modules 
# env # View environment variables 
# arch Show the processor architecture of the machine (1) 
# uname -m Show the processor architecture of the machine ( 2) 
# uname -r shows the kernel version in use 
# dmidecode -q shows the hardware system components 
# hdparm -i /dev/hda lists the architectural characteristics of a disk 
# hdparm -tT /dev/sda performs a test read on the disk Operation 
# cat /proc/interrupts show interrupts 
# cat /proc/meminfo check memory usage 
# cat /proc/swaps show which swaps are used 
# cat /proc/version show kernel version 
# cat /proc/net/dev show network Adapters and statistics 
# cat /proc/mounts show mounted filesystems 
# lspci -tv list PCI devices 
# lsusb -tv show usb devices 
# date show system date 
# cal 2007 show 2007 calendar 
# date 041217002007.00 set date and time – month day hour minute year. second 
# clock -w save time changes to BIOS

System shutdown, restart and logout 
# shutdown -h now shutdown system(1) 
# init 0 shutdown system(2) 
# telinit 0 shutdown system(3) 
# shutdown -h hours:minutes & shutdown system at scheduled time 
# shutdown - c Cancel the shutdown of the system according to the scheduled time 
# shutdown -r now restart (1) 
# reboot restart (2) 
# logout logout

How to view linux system 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 the total amount of memory 
# grep MemFree /proc/meminfo # View the amount of free memory 
# uptime # View system running time, number of users, load 
# cat /proc/loadavg # View system load

how to view linux disks and partitions

# mount | column -t # 查看挂接的分区状态 
# fdisk -l # 查看所有分区 
# swapon -s # 查看所有交换分区 
# hdparm -i /dev/hda # 查看磁盘参数(仅适用于IDE设备) 
# dmesg | grep IDE # 查看启动时IDE设备检测状况

查看网络配置的命令

# ifconfig # 查看所有网络接口的属性 
# iptables -L # 查看防火墙设置 
# route -n # 查看路由表 
# netstat -lntp # 查看所有监听端口 
# netstat -antp # 查看所有已经建立的连接 
# netstat -s # 查看网络统计信息

查看linux进程

# ps -ef # 查看所有进程 
# top # 实时显示进程状态

查看用户的命令

# w # 查看活动用户 
# id <用户名> # 查看指定用户信息 
# last # 查看用户登录日志 
# cut -d: -f1 /etc/passwd # 查看系统所有用户 
# cut -d: -f1 /etc/group # 查看系统所有组 
# crontab -l # 查看当前用户的计划任务

查看系统服务的命令

# chkconfig –list # 列出所有系统服务 
# chkconfig –list | grep on # 列出所有启动的系统服务

安装程序的命令

# rpm -qa # 查看所有安装的软件包

获取帮助的命令

#man <命令> #获得命令帮助

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326645308&siteId=291194637