Create persistent, safe aliases to shorten commands and speed up your shell workflow. 16.11.2025 | reading time: 3 min Aliases turn long commands into short nicknames; this guide shows how to create persistent, safe bash aliases, test them immediately, and know when a function or script is a better choice. Make a Practical Alias Follow these steps to add two useful aliases and apply them immediately: ``` # append aliases to a dedicated file echo "alias ll='ls -alF'" >> ~/.bash_aliases echo "alias gs='git status'" >> ~/.bash_aliases # load them into the current shell source ~/.bash_aliases # inspect and verify alias ll # sample verification of alias type type ll ``` After running the above, `alias ll` prints the alias definition and `type ll` shows that `ll` is aliased to "ls -alF". Avoid Common Pitfalls Aliases do not accept positional parameters, so prefer a bash function when you need arguments; if he must bypass an alias in a single command he can prefix it with a backslash like `\rm` or call the full path; use `unalias name` to remove an alias and `alias -p` to print aliases in reusable form, and remember aliases are expanded only in interactive shells unless you enable `shopt -s expand_aliases`. Where To Keep Aliases Place personal shortcuts in `~/.bash_aliases` and source that file from `~/.bashrc` (many distributions already do this), or add them directly to `~/.bashrc`; a common snippet is: `if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases; fi`, which keeps configuration tidy and portable across machines. When To Use Functions Or Scripts If logic grows beyond a single command—loops, conditionals, parameter parsing—convert the alias into a shell function or an executable script in `~/.local/bin` so the behavior remains readable, testable, and usable in non-interactive sessions. Ready For More Start small, collect useful shortcuts, and refactor recurring tasks into functions or scripts; if you want to deepen Linux skills and prepare for certification, consider focused study for CompTIA Linux+ or LPIC-1 with intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. scripting utilities setup