Skip to content

Instantly share code, notes, and snippets.

@DallasO
Last active April 14, 2023 23:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DallasO/cd3ae1ff461d1200ce12cc2a06187340 to your computer and use it in GitHub Desktop.
Save DallasO/cd3ae1ff461d1200ce12cc2a06187340 to your computer and use it in GitHub Desktop.
My Bash aliases
## BASIC
alias x='exit'
alias c='clear'
alias ll='ls -lh' # List files/dirs, `-l` with more details, `-h` show filesize in human-readable format
alias grep='grep --color=auto' # COLORSS!
## Routine
alias update='sudo apt update && apt list --upgradeable' # Check for updates
alias upgrade='sudo apt upgrade --auto-remove' # Install those updates
alias autoremove='sudo apt autoremove && sudo apt autoclean' # Run every few months to clear apt cache
alias aptinstall='sudo apt install' # Install something from apt
alias aptremove1='sudo apt remove --auto-remove' # Uninstall something and KEEP config files
alias aptremove2='sudo apt purge --auto-remove' # Uninstall something and DELETE congig files
alias distgrade='sudo apt dist-upgrade --auto-remove' # Upgrade your system when a new major version is released **DANGEROUS**
## MISC.
alias python='python3'
alias py='python3'
alias search='apt search' # Search for a package
alias search-names-only='apt search --names-only'
## Optional
# Use a secrets file for aliases specific to one computer,
# this way, you can copy your normal `.bash_aliases` to
# any new computer and feel at home
# You can also share your `.bash_aliases` without worrying
# about sharing sensitive commands
if [ -f ~/.bash_secrets ]; then
. ~/.bash_secrets
fi
# Examples of SENSITIVE commands you probably shouldn't share
alias server1@='ssh -p 2224 user1@10.10.100.100'
alias server2@='ssh user2@10.10.100.101'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment