Add them to your bashrc/zshrc! Never think about which OS you're currently using!
Usage:
sea some key wordsins package-1 package-2 package-3| # often used apt-get aliases | |
| if [ -x /usr/bin/apt-get ]; then | |
| alias ins='sudo apt install' | |
| alias sea='sudo apt search' | |
| alias update='sudo apt-get -y update && sudo apt-get upgrade' | |
| alias apt-history='(zcat /var/log/apt/history.log.*.gz; cat /var/log/apt/history.log) | grep -B1 Commandline' | |
| alias apt-hist='(zcat /var/log/apt/history.log.*.gz; cat /var/log/apt/history.log) | egrep "Commandline.* (install|remove)" | cut -c22-' | |
| elif [ -x /usr/bin/yum ]; then | |
| GRML_NO_APT_ALIASES=1 | |
| alias ins='sudo yum install' | |
| alias update='sudo yum update' | |
| alias yum='sudo yum' | |
| elif [ -x /usr/bin/yay ]; then | |
| GRML_NO_APT_ALIASES=1 | |
| alias ins='yay -S --needed' | |
| alias sea='yay -Ss' | |
| alias update="yay -Syu" | |
| elif [ -x /usr/bin/pacman ]; then | |
| alias ins='sudo pacman -S --needed' | |
| alias sea='pacman -Ss' | |
| alias update="sudo pacman -Syu" | |
| elif [ -x /usr/local/bin/brew ] || [ -x /opt/homebrew/bin/brew ]; then | |
| function ins() { | |
| for prog in "$@"; do | |
| if info=$(brew info "$prog" 2>&1); then | |
| brew install "$prog" | |
| else | |
| echo "$info" | |
| fi | |
| done | |
| } | |
| alias sea='brew search' | |
| alias update='brew update && brew upgrade' | |
| fi |