「Linux」- 在操作系统安装后……

  CREATED BY JENKINSBOT

CentOS 7.x

# 每次安装完 CentOS 之后,这几个命令总要执行一下
yum install -y epel-release
yum install -y bash-completion tmux yum-cron yum-utils
yum install -y sysstat procps-ng psmisc

# 取消「You have mail in /var/spool/mail/root」提示
echo 'unset MAILCHECK'  >> .bashrc

# 调整PS1变量
cat >> ~/.bashrc  <<EOF
export PS1="\e[01;31m\u@\h \w\e[00m""\e[34;1m\e[0m""\n""# "
EOF

# 重新登录一下
exec su - root

Debian-based Linux distributions

#### 添加自定义设置
cat >> ~/.bashrc <<EOF

# 调整PS1变量
export PS1="\e[01;31m\u@\h \w\e[00m""\e[34;1m\e[0m""\n""# "

# 常用命令别名
alias ll='ls -l -a --color'
alias ls='ls -a --color'
EOF

#### 安装常用工具,以方便系统维护管理
apt-get install -y vim tmux rsync tree

#### 重新登录,以使配置生效
exec su - root

#### 配置源,以提高应用的安装速度(可选)
cp /etc/apt/source.list /etc/apt/source.list.backup
cat > /etc/apt/source.list <<EOF
deb https://mirrors.aliyun.com/debian  stable main contrib non-free
deb https://mirrors.aliyun.com/debian  stable-updates main contrib non-free
EOF
apt-get update