[NEW] pacpruner: Added pacman pruner script and usage calculator
This commit is contained in:
parent
b4e2541e50
commit
d6a5fe58e5
2 changed files with 104 additions and 0 deletions
18
scripts/pacpruner-calculator
Executable file
18
scripts/pacpruner-calculator
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
read -d '' usage <<EOUSAGE
|
||||
This script calculates the amount of space (in kibibytes) taken by the files
|
||||
referenced in a newline-delimited listing.
|
||||
|
||||
USAGE: $0 FILE_LIST
|
||||
EOUSAGE
|
||||
|
||||
. "$(dirname $0)/util/logging.bash"
|
||||
|
||||
[ -z "$1" ] && dedcat "$usage"
|
||||
|
||||
read -d '' PERL <<EOPERL
|
||||
print $(cat "$1" | xargs du | awk '{print $1}' | tr $'\n' '+' | sed 's/+$//')
|
||||
EOPERL
|
||||
|
||||
perl -e "$PERL"' . "\n";'
|
||||
Loading…
Add table
Add a link
Reference in a new issue