记录一些Linux的常用命令,基于CentOS 7.6下
一、查看Linux版本,其实是通过使用Cat命令查看版本文件,Linux一切皆是文件!!
[root@VM_0_9_centos etc]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
二、更改主机名,通过vim命令修改文件/etc/hostname来实现
[root@VM_0_9_centos etc]# vim /etc/hostname
1、进行vim后,按i进入编辑模式。
2、将文件内容修改为你所需的主机名后,按Esc键退出编辑模式。
3、输入 :(按 shift + ; 键),进入VIM的命令行模式,输入 wq,保存修改退出。