System-wide environment variables
Add global environment variables in 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:
JAVA_HOME=/usr/lib/jvm/default-java
So do not add "export" before assignments. Variable expansion does not work in this file.
User specific environment variables
Add user level environment variables in file ~/.zshenv. For example, to override system PATH:
export PATH=$HOME/apps/spark-1.0.2-bin-hadoop2/bin:$PATH
User aliases setup
For bash there is a ~/.bash_aliases file, so we define aliases in this file, and load it in zsh with adding following codes into ~/.zshrc:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
Some example in ~/.bash_aliases:
alias gst='git status'
alias dn='$HOME/apps/dsnote/donshell.sh'
Refs: