Repeated option-heavy commands are easy to mistype in an interactive Bash terminal, especially when the same command is run many times during one session. A Bash alias gives that command a short name for simple replacements such as a preferred ls format, while shell functions are better for shortcuts that need arguments, tests, or branching.
The alias builtin stores a name-to-command mapping in the current interactive shell. A temporary alias starts working as soon as it is defined, and unalias removes it from that shell without changing any startup file.
Persistent aliases belong in ~/.bashrc on typical Bash terminals because that file is read for interactive non-login shells. Check the file syntax, reload it with source, then verify both the stored definition and the command output before relying on the shortcut.
Related: How to configure Bash login scripts
Related: Create and use aliases in Zsh
$ alias ll='ls -lh'
$ alias ll alias ll='ls -lh'
$ ll ~/projects/demo total 0 -rw-r--r-- 1 operator operator 0 Jun 5 02:11 report.txt
Bash expands aliases in interactive shells by default. Scripts should use functions or full commands instead of depending on user aliases.
$ unalias ll
$ nano ~/.bashrc
alias ll='ls -lh'
Keep interactive aliases in ~/.bashrc. Use a function instead when the shortcut needs parameters, tests, or more than one command.
Related: How to create a function in Bash
$ bash -n ~/.bashrc
No output from bash -n means Bash parsed the file without finding a syntax error.
$ source ~/.bashrc
$ alias ll alias ll='ls -lh'
$ ll ~/projects/demo total 0 -rw-r--r-- 1 operator operator 0 Jun 5 02:11 report.txt