An alias is a shortcut for a long command. Instead of typing the full command every time, you create a short name for it.
alias short_name="your command"
alias l="ls" # Type 'l' instead of 'ls'
alias ll="ls -la" # Type 'll' for detailed list
alias gs="git status" # Shortcut for git status
alias cls="clear" # Windows-style clear
alias -p
unalias short_name
Aliases created in terminal are temporary (lost after session ends).
To make them permanent, add them to
~/.bashrcor~/.bash_aliasesand runsource ~/.bashrc.
Environment variables store information that programs and the shell can use — like paths, usernames, or config values.
MYVAR="hello world" # Set variable (only in current shell)
export MYVAR="hello world" # Export makes it available to child processes