玩转Ubuntu 环境变量
玩转Ubuntu 环境变量
查看环境变量
设置环境变量
Locale
Reference
1. 查看环境变量
env
printenv
Locale
locale -a
zsh add alias
.zshrc / source ~/.zshrc
2. 设置环境变量
/etc/environment - A suitable file for environment variable settings that affect the system as a whole (rather than just a particular user) is
While /etc/profile is often suggested for setting environment variables system-wide, it is a configuration file of the base-files package, so it's not appropriate to edit that file directly. Use a file in /etc/profile.d instead as shown above. (Files in /etc/profile.d are sourced by /etc/profile.)
/etc/default/locale is specifically meant for system-wide locale environment variable settings. It's written to by the installer and when you use Language Support to set the language or regional formats system-wide. On a desktop system there is normally no reason to edit this file manually.
The shell config file /etc/bash.bashrc is sometimes suggested for setting environment variables system-wide. While this may work on Bash shells for programs started from the shell, variables set in that file are not available by default to programs started from the graphical environment in a desktop session.