Useful CLI tools (bash) for Arch Linux administration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
784 B

6 years ago
  1. #!/bin/bash
  2. #################################
  3. # Gather some package information with pacman on Arch Linux
  4. FILETHRESHOLD=100
  5. if [[ $2 == "local" ]]; then
  6. pacman -Qi $1
  7. if [[ $3 == "files" ]]; then
  8. if [[ $(pacman -Ql $1 | wc -l) -gt $FILETHRESHOLD ]]; then
  9. echo "Package $1 has $(pacman -Ql $1 | wc -l) files/dirs"
  10. sleep 3
  11. pacman -Ql $1 | less
  12. fi
  13. fi
  14. elif [[ $2 == "remote" ]]; then
  15. pacman -Si $1
  16. if [[ $3 == "files" ]]; then
  17. if [[ $(pacman -Ql $1 | wc -l) -gt $FILETHRESHOLD ]]; then
  18. echo "Package $1 has $(pacman -Ql $1 | wc -l) files/dirs"
  19. sleep 3
  20. pacman -Ql $1 | less
  21. fi
  22. fi
  23. else
  24. echo -e "Input: sh pkginfo.sh <package> [local/remote] [files]\n"
  25. fi