CentOS如何修改root用户登录时默认目录

如何修改root用户默认目录,修改/root/.bash_profile文件,只要加一行cd 路径就可以。

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

cd /home/test                #加了这行
PATH=$PATH:$HOME/bin           #这行没改动

export PATH

修改其它用户的配置,这个文件应该是在/home/username/.bash_profile
(username为登录用户名)。

如何修改用户主机名?

1、修改/etc/hostname(需要重启才生效)

echo 'bbb' > /etc/hostname

2、用命令修改(不需要重启)

hostnamectl set-hostname bbb

bash

版权声明:
作者:凯影
链接:https://www.sxszhian.com/archives/9973
来源:上海永驰网络科技有限公司
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
< <上一篇
下一篇>>