系统信息

查看系统信息:

1
2
lsb_release -a
cat /etc/issue

查看内核版本信息

1
2
3
4
5
uname -a #-a all,更多参数--help查看
cat /proc/version

# 查看系统位数
getconf LONG_BIT

查看进程信息

1
2
3
4
5
# 查看占用CPU前十的进程
ps auxhead -1;ps auxgrep -v PIDsort -rn -k +3head

# 查看占用内存前十的进程
ps auxhead -1;ps auxgrep -v PIDsort -rn -k +4head

查看硬件信息

查看机器型号

1
dmidecode  grep "Product Name"

CPU信息

/proc/cpuinfo记录了关于cpu的信息

1
2
3
4
5
6
7
8
# 查看cpu型号
cat /proc/cpuinfo grep namecut -f2 -d:uniq -c
# cpu个数
cat /proc/cpuinfo grep "physical id" uniq wc -l
# 每个cpu的核数
cat /proc/cpuinfo grep "cpu cores" uniq
# 逻辑cpu的个数
cat /proc/cpuinfo grep "processor" wc -l

内存信息

/proc/meminfo记录了关于内存的信息

1
2
3
4
5
6
7
8
# 内存总数
cat /proc/meminfo grep MemTotal
# 查看内存插槽几个,以及安了几条内存。
dmidecode grep -A16 "Memory Device$"

#这样更直观些
dmidecode grep -A16 "Memory Device$"grep Size
free -h

网卡信息

1
2
3
4
dmesg  grep -i eth

# 查看有几块网卡
lspci grep -i eth

系统设置

区域与语言设置

1
2
3
4
5
6
# 语言设置
dpkg-reconfigure locales
# 更改时区
pkg-reconfigure tzdata
# 同步时间
ntpdate time.nist.gov