SHARE
TWEET

Untitled

a guest Jun 20th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # ações cotidianas
  2. alias up='sudo apt update'
  3. alias upl='echo -e "$(apt list --upgradable 2>/dev/null)" | less'
  4. alias upg='sudo apt upgrade'
  5. alias apti='sudo apt install'
  6.  
  7. # busca pacotes instalados (sem argumentos=todos)
  8. aptinstalled() {
  9.     echo ""
  10.     list="$(apt list --installed 2>/dev/null)"
  11.     if [[ $# -eq 0 ]]; then
  12.         less <<< $list
  13.     else
  14.         for pkg in "$@"; do
  15.             grep -e $pkg <<< $list
  16.         done
  17.     fi
  18.     echo ""
  19. }
  20.  
  21. # info dos pacotes pesquisados
  22. aptinfo() { apt-cache show "$@" | less; }
  23.  
  24. # busca pacotes disponíveis
  25. aptsearch() { apt-cache search "$@" | sort | less; }
  26.  
  27. # Autocompletar dos aliases apt(x)
  28. auto_complete_apt() {
  29.     mapfile -t COMPREPLY < <(apt-cache --no-generate pkgnames "$2");
  30. }
  31. complete -F auto_complete_apt apti
  32. complete -F auto_complete_apt aptsearch
  33. complete -F auto_complete_apt aptinfo
  34. complete -F auto_complete_apt aptinstalled
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top