每个用户都可使用 ~/.bash_profile 文件输入专用于自己使用的 shell 信息,~ 表示用户的家目录,如 root 用户就是 /root/.bash_profile
当用户登录 shell 时就执行该文件,该文件仅仅执行一次,默认情况下,该文件设置一些环境变量,执行用户的 .bashrc 文件,默认配置如下:

[root@localhost ~]$ cat /root/.bash_profile 
# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

 

 

 

 

 

 

 

     

相关文章:

  • 2022-01-01
  • 2021-12-27
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2021-06-17
  • 2022-03-04
相关资源
相似解决方案