centos6和7都属于linux操作系统的一种。
区别:1、centos7内核是“3.10”,centos6内核是“2.6”;2、文件系统不一样,centos6默认用ext4,而centos7用xfs;3、硬盘默认调度算法不一样,centos6用cfq,而centos7用deadline。
# 系统版本
cat /etc/redhat-release
# Red Hat Enterprise Linux Server release 6.5 (Santiago)
uname -a
# Linux WXPT-WEB1 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
# 如果普通用户显示 bash4.1 修改.bash_profile 即可
cd ~ #进入自己家目录
echo "export PS1='[\u@\h \W]\$ '" >> .bash_profile
source .bash_profile
# 有的还是会显示这样
I have no name!@hostname
# 第一种方法 手动修改
vim .bash_profile
# export PS1='[\u@\h \W]\$ '
export PS1='[\demo@\h \W]\$ ' # 用户是demo的时候
export PS1='[\xiandai@\h \W]\$ ' #用户是xiandai的时候
source .bash_profile
# 第二种方法 但是我没成功 不知道怎么回事
chmod 644 /etc/passwd