From bash to zsh and everywhere in between, show me yours and I’ll show you mines. Inspire others or get some feedback.

Simply copy & paste the output of alias in your terminal or add some comments to explain things for others.

Edit: Kbin users, click ‘More’ on a comment and use the fediverse link to read responses that have funky formatting

  • @ShittyBeatlesFCPres
    link
    English
    31 year ago

    Actually that’s the install one. Here’s the upgrade one:

    
    function upg {
      exists() {
        command -v "$1" >/dev/null 2>&1
      }
    
      if exists dnf; then #Fedora
        sudo dnf update && sudo dnf -y upgrade && sudo dnf -y autoremove
      elif exists apt; then #Debian
        sudo apt update && sudo apt full-upgrade -y
      elif exists apk; then #Alpine
        apk -U upgrade
      elif exists emerge; then #Gentoo
        sudo emerge --ask --verbose --update --deep --newuse @world && sudo emerge --ask --verbose --depclean
      elif exists zypper; then #Suse
        sudo zypper ref && sudo zypper update
      elif exists pacman; then #Arch
        pacman -Syu
      elif exists brew; then #MacOS
        brew update && brew upgrade
      else
        echo "Error: cannot update packages. No package manager is detected."
        exit 1;
      fi
    
      if exists snap; then #Snaps
        sudo snap refresh
      fi
      if exists flatpak; then #Flatpak
        flatpak update -y
      fi
    }