查看系统内核版本:uname -a
查看系统版本: cat /etc/redhat-release
查看当前用户:whoami
添加用户:useradd test
设置密码:passwd test
更新源的国内镜像
cat /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.163.com/.help/centos.html
必要软件包:
yum install tree telnet dos2unix sysstat lrzsz -y
查看已经安装的包组
yum grouplist
安装包:
yum groupinstall "xxxx"
关闭SElinux
cat /etc/selinux/config sed -i s#SELINUX=enforcing#SELINUX=disabled#g /etc/selinux/config grep "disabled" /etc/selinux/config getenforce setenforce 0
启动等级模式
cat /etc/inittab runlevel vim /etc/inittab init 3
精简开机系统启动服务
setup ntsysv 脚本一键完成处理 要求只打开:crond network rsyslog sshd 4个服务 LANG=en 设置开机自动启动:chkconfig --list|grep "3:on" chkconfig sshd off 1.先全关闭,再开启 for test in `chkconfig --list|grep "3:on"|awk '{print $1}'`;do chkconfig $test off;done for test in crond network sshd rsyslog;do chkconfig $test on;done 2.只开启指定的 for test in `chkconfig --list|grep "3:on"|awk '{print $1}'|grep -vE "crond|network|sshd|rsyslog"`;do chkconfig $test off;done
停留在世界边缘,与之惜别