1,查看cpu信息

     lscpu        

2,网络配置

     ip  route   查看路由

     nmcli

     nmcli connection show    显示所有连接

     nmcli connection show -a    仅显示当前活动的连接

     nmcli device status  列出 NetworkManager 识别出的设备列表及他们的状态

     nmcli device disconnect eno16777736    停止接口

     nmcli device connect eno16777736        启动接口


     nmtui   类似centos6中的 setup

   

     配置主机名

     /etc/hostname

     hostnamectl

     hostname

     


3,系统语言设置

     区域设置的配置文件在/etc/locale.conf,通过localectl命令进行设置;

     localectl status     查看当前配置

     localectl list-locales |grep CN      查看可用的区域语言

     localectl set-locale LANG=zh_CN.utf8    设置区域语言

     

4,配置时间和日期

     timedatectl    date

     timedatectl    等同于timedatectl status

     timedatectl set-time YYYY-MM-DD    设置日期

     timedatectl set-time HH:MM:SS    设置当前时间

     timedatectl set-local-rtc boolean    默认的,系统是使用UTC时间的,可以用以下命令打开和关闭UTC时间

                                                          把 boolean 替换成yes则表示使用本地时间,替换成no则表示是UTC时间

                                                          注:这里的boolean值也可以用true、flase

     timedatectl list-timezones    查看所有的时区

     timedatectl set-timezone time_zone    用以下命令设置时区

     设置时区也可以直接复制系统文件 :

     timedatectl set-ntp boolean  timedatectl还可以设置是否打开NTP选项 (这里的boolean是yes或者no)

     # cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


5,时钟同步配置 

     /etc/chrony.conf    

     timedatectl

     ntpdate

     

6,strace  ltrace


7,系统服务

     systemctl -at service

     ls /etc/systemd/system/*.service

     ls /usr/lib/systemd/system/*.service

     查看活动的服务

     systemctl -t service --state=active


     启动/停止 服务

     systemctl start name.service

     systemctl stop name.service


     设置开机是否启动服务

     systemctl enable name.service

     systemctl disable name.service

     

     查看服务器状态

     systemctl status name.service


     检查服务是否enabled

     systemctl is-enabled name


     创建新的服务

     systemctl daemon-reload  /etc/systemd/system/*.service


8,运行级别

     查看

     who -r

     runlevel

     修改

     切换到:运行级3

     systemctl isolate multi-user.target   或 systemctl isolate runlevel3.target

     切换到:运行级5

     systemctl isolate graphical.target    或  systemctl isolate runleve5.target

     修改开机默认运行级别

     systemd使用链接来指向默认的运行级别,由/etc/systemd/system/default.target文件中决定

     切换到运行级3:

     先删除:/etc/systemd/system/default.target

     ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

     ln -sf /lib/systemd/system/runlevel3.target /etc/systemd/system/default.target

     或 

     systemctl set-default multi-user.target


9,日志

     /var/log

     journalctl


10,配置grub

     /etc/default/grub

     grub-set-default

     grub2-mkconfig


11,查看硬件信息

     lshw (in EPEL)

     yum install  epel-release  -y 

     yum install  lshw  -y


12,加载、配置内核模块

     modprobe

     删除内核模块

     modprobe -r

     查看内核参数

     sysctl -a

     cat /proc/cmdline


13,chsh

    这就是 change shell 的简写!使用方法就更简单了!

    

  chsh [-s shell] [-l] [-u] [-v] [username]

  选项与参数:

  -l :列出目前系统上面可用的 shell ,其实就是 /etc/shells 的内容!

  -s :设定修改自己的 Shell


  #chsh -l

  #chsh -s /sbin/nologin  user1


14,useradd  -D

    

GROUP=100

HOME=/home

INACTIVE=-1

EXPIRE=

SHELL=/bin/bash

SKEL=/etc/skel

CREATE_MAIL_SPOOL=yes



15,