Shell Aliases
Here you'll find a few handy aliases to use in ZSH and Bash Shell. Tested on Linux - likely work on Mac!
# Make changing directory up easieralias ..='cd ..'alias ...='cd ../../'alias ....='cd ../../../'
# Make ls show directory endingsalias ls='ls -FA --color'# Make sl list files ('ls')alias sl='ls'# Make ls -l show in human-readable formatalias ll='ls -lhFA --color'
# Show human readable file sizes in directoryalias du='du -ach | sort -h'
# Show human-readable free memoryalias free='free -th'
# Make diff side-by-sidealias diff='diff -y --color'
# Copy file contents to clipboard (USAGE: clip [FILE])alias clip='xclip -sel clip <'
# Get numerical file permissions of filealias perm='stat -c "%a %n"'
# Ping 3 times rather than infinitealias ping='ping -c 3'
# Make directory and parent directories, and output which directories have been createdalias mkdir="mkdir -pv"
# Flush DNS cachealias flushdns='sudo resolvectl flush-caches'
Conclusion
These shell aliases demonstrate how small customizations can significantly improve your command-line productivity. By adding these to your ~/.bashrc or ~/.zshrc file, you'll have convenient shortcuts that make common tasks faster and safer. From easier directory navigation with .. and ... to human-readable output with modified ls, du, and free commands, each alias solves a specific friction point in daily terminal work.
Start by adding the aliases that align with your most frequent tasks, then gradually expand your collection as you identify other repetitive commands. Remember to source your configuration file after making changes with source ~/.bashrc or source ~/.zshrc to load the new aliases. These simple productivity enhancements can save you countless keystrokes and help prevent common mistakes, making your command-line experience smoother and more efficient.