Centos和Ubuntu系统最小化安装基础命令和centos系统初始化
基础软件
CentOS系统常用的基础软件
yum install vim iotop bc gcc gcc-c++ glibc glibc-devel pcre \ pcre-devel openssl openssl-devel zip unzip zlib-devel net-tools \ lrzsz tree ntpdate telnet lsof tcpdump wget libevent libevent-devel \ bc systemd-devel bash-completion traceroute -y
Ubuntu系统常用基本软件
apt-get -y install iproute2 ntpdate tcpdump telnet traceroute nfs-kernel-server nfs-common lrzsz tree \
openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev ntpdate tcpdump telnet traceroute gcc openssh-server \
iotop unzip zip
系统初始化相关
更换yum源仓库
cd /etc/yum.repos.d/ mkdir repo.bak mv *.repo repo.bak/ wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo yum install -y epel-release yum clean all yum repolist
命令别名设置 vim ~/.bashrc # 本人常用
alias 30='PS1="\[\e[1;30m\][\u@\h \W]\\$ \[\e[0m\]"'
alias 31='PS1="\[\e[1;31m\][\u@\h \W]\\$ \[\e[0m\]"'
alias 32='PS1="\[\e[1;32m\][\u@\h \W]\\$ \[\e[0m\]"'
alias 33='PS1="\[\e[1;33m\][\u@\h \W]\\$ \[\e[0m\]"'
alias 34='PS1="\[\e[1;34m\][\u@\h \W]\\$ \[\e[0m\]"'
alias 35='PS1="\[\e[1;35m\][\u@\h \W]\\$ \[\e[0m\]"'
alias 36='PS1="\[\e[1;36m\][\u@\h \W]\\$ \[\e[0m\]"'
alias cl='clear'
alias df='df -h'
alias ll='ls -lh'
alias lld='ls -lhd'
alias jjar="java -jar $@"
alias ipa="ip a"
alias cdnet="cd /etc/sysconfig/network-scripts/"
alias lsnet="ls /etc/sysconfig/network-scripts/"
alias yin="yum install -y"
alias yre="yum remove -y"
alias ls='ls --color=auto'
alias cl="clear"
alias lld="ll -d"
alias df="df -h"
alias du="du -h"
alias dus="du -sh"
alias dft="df -hT"
alias pp="ping -c 2 8.8.8.8"
# 退出保存
最后需要source ~/.bashrc 即可
以上都是我安装完系统后第一步需要做的,日后用起来很方便
我有梦,有远方,我会为了它们奔跑,奋斗,直到成为连我自己都佩服的人。