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

#!/bin/bash
#################################
# Gather some package information with pacman on Arch Linux
FILETHRESHOLD=100
if [[ $2 == "local" ]]; then
pacman -Qi $1
if [[ $3 == "files" ]]; then
if [[ $(pacman -Ql $1 | wc -l) -gt $FILETHRESHOLD ]]; then
echo "Package $1 has $(pacman -Ql $1 | wc -l) files/dirs"
sleep 3
pacman -Ql $1 | less
fi
fi
elif [[ $2 == "remote" ]]; then
pacman -Si $1
if [[ $3 == "files" ]]; then
if [[ $(pacman -Ql $1 | wc -l) -gt $FILETHRESHOLD ]]; then
echo "Package $1 has $(pacman -Ql $1 | wc -l) files/dirs"
sleep 3
pacman -Ql $1 | less
fi
fi
else
echo -e "Input: sh pkginfo.sh <package> [local/remote] [files]\n"
fi