1、查看CPU信息(型号)
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
2、# 查看物理CPU个数
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
3、# 查看每个物理CPU中core的个数(即核数)
cat /proc/cpuinfo| grep "cpu cores"| uniq
4、# 查看逻辑CPU的个数
cat /proc/cpuinfo| grep "processor"| wc -l
5、查看gpu占用情况
watch -n 0.1 nvidia-smi
查看GPU信息
nvidia-smi
6、查看Linux系统版本的命令
cat /etc/issue 或 cat /etc/redhat-release 此命令也适用于所有的Linux发行版。
[root@S-CentOS home]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
cat /proc/version
Linux version 3.10.0-514.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Tue Nov 22 16:42:41 UTC 2016
7、查看文件占用大小
du --max-depth=1 -h /usr/local/tomcat_bjtu2/bin/* 文件路径
8、redhat7关闭防火墙
systemctl stop firewalld.service
systemctl stop firewalld.service
9、查看应用程序所有依赖的lib
ldd 应用程序名称
10、配置网络yum源
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
11、修改ip
vi /etc/sysconfig/network-scripts/ifcfg-eth0
12、查看安装了那些应用
yum list installed