zoukankan      html  css  js  c++  java
  • Linux_UBUNTU_EnvironmentVariables

    /etc/environment  /etc/profile  ~/.profile   /etc/bash.bashrc  ~/.bash  /etc/motd  ~/.pam_environment

    Script

    /etc/bash.bahrc  # for all users

    ~/.bash      # for individual user

    ~/bash_profile

    Shell config files such as ~/.bashrc~/.bash_profile, and ~/.bash_login are often suggested for setting environment variables. While this may work on Bash shells for programs started from the shell, variables set in those files are not available by default to programs started from the graphical environment in a desktop session.

    Configuration File:

    /etc/environment    #This file is specifically meant for system-wide environment variable settings. It is not a script file, but rather consists of assignment expressions, one per line.

    ~/.pam_environment   #This file is specifically meant for setting a user's environment. It is not a script file, but rather consists of assignment expressions, one per line.

    Enivronment Variable

    https://help.ubuntu.com/community/EnvironmentVariables#Manipulating_environment_variables_and_values

    Difference between bash.bashrc and /etc/environment file 

    https://askubuntu.com/questions/150789/difference-between-bash-bashrc-and-etc-environment-file

    Difference between /etc/environment and .profile

    https://askubuntu.com/questions/866161/setting-path-variable-in-etc-environment-vs-profile?noredirect=1

    sequence of scripts sourced upon login

     https://askubuntu.com/questions/463462/sequence-of-scripts-sourced-upon-login

    You seem to be logging in via ssh which means you're running an interactive login shell, see above for what that means. So, in summary, the things you care about that are sourced when you log in are (and in this order):

    1. The SSH daemon, via the pam_motd module of the PAM library, displays the contents of /etc/motd. Via the pam_env module, it sets the environment variables from /etc/environment and ~/.pam_environment.
    2. A login shell is started, and the following files are read in order:
      1. /etc/profile
      2. /etc/bash.bashrc (the default Ubuntu /etc/profile sources /etc/bash.bashrc).
      3. ~/.bash_profile. The other files that could have been read here (~/.profile and ~/.bash_login) are ignored because ~/.bash_profile exists.
  • 相关阅读:
    JZOJ8月10日提高组T2 Fix
    【GDOI2007】JZOJ2020年8月10日提高组T1 夏娜的菠萝包
    JZOJ8月10日提高组反思
    【NOIP2012模拟8.7】JZOJ2020年8月8日提高组T1 奶牛编号
    JZOJ8月8日提高组反思
    【佛山市选2013】JZOJ2020年8月7日T4 排列
    【佛山市选2013】JZOJ2020年8月7日提高组T3 海明距离
    【佛山市选2013】JZOJ2020年8月7日提高组T2 树环转换
    【佛山市选2013】JZOJ2020年8月7日提高组T1 回文子序列
    写给在工厂上班的大学同学们
  • 原文地址:https://www.cnblogs.com/tlfox2006/p/7399351.html
Copyright © 2011-2022 走看看