Linux1.11.shell(环境变量配置文件)

  • source命令

    • 作用 source 配置文件或者.配置文件 直接让配置文件生效 不用注销或重新登陆
  • 环境变量配置文件

    • 环境变量配置文件中主要是定义对系统的操作环境生效的系统默认环境变量,比如PATH,HISTSIZE,PS1,HOSTNAME等默认环境变量
  • 系统主要有五类环境变量配置文件

    • /etc/profile
    • /etc/profile.d/*.sh 一组文件
    • ~/.bash_profile
    • ~/.bashrc
    • /etc/bashrc
    • 所有etc下的文件 对登陆用户都生效
  • /etc/profile的作用

    • user变量
    • LOGNAME变量
    • mail变量
    • PATH变量
    • hostname变量
    • histsize变量
    • umask:
    • 调用/etc/profile.d/*.sh文件
  • 其他环境变量配置文件

    • 注销时生效的环境变量配置文件 ~/.bash_logout
    • 历史命令配置文件 ~/.bash_history
    • 本地终端提示信息 /etc/issue
    • 远程登陆提示信息 /etc/issue.net
      • 是否显示是由/etc/ssh/sshd_config决定 加入"banner/etc/issue.net"行才能生效 需要重启ssh
    • 登陆后提示信息 /etc/motd 远程本地都生效
原文地址:https://www.cnblogs.com/FGdeHB/p/15570469.html