1-Linux - 常用命令

about

环境:centos7.7

常用命令

关闭防火墙和selinux

# 查看防火墙状态
systemctl status firewalld.service
# 关闭防火墙
systemctl stop firewalld.service
# 禁止开机启动防火墙
systemctl disable firewalld.service
# 启动防火墙
systemctl start firewalld.service
# 防火墙随系统开启启动
systemctl enable firewalld.service

# 关闭selinux
[root@r ~]# sed -i.ori 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config

完事后可以重启服务器。

更改主机名

1. 命令行设置
  hostnamectl set-hostname xxx  # 内部也是修改hostname文件
2. 修改hostname文件
  vim /etc/hostname # 更改内容并保存

上面两种无论哪一种都要reboot重启服务器。

vim编辑器设置行号

vim ~/.vimrc
# 编辑如下内容
set number

alias为指定命令设置别名

vim /etc/profile,完事source /etc/profile

alias cls="clear"

that's all, see also:

linux下alias命令详解

posted @ 2020-04-18 11:30  听雨危楼  阅读(461)  评论(0编辑  收藏  举报