Skip to content

Instantly share code, notes, and snippets.

@hiddenillusion
Last active January 16, 2020 20:32
Show Gist options
  • Save hiddenillusion/fb710f0e0b280f30c5bcff3daed3135e to your computer and use it in GitHub Desktop.
Save hiddenillusion/fb710f0e0b280f30c5bcff3daed3135e to your computer and use it in GitHub Desktop.
TOTAL_EXPECTED_FILES=$1
INGESTED=`find /path/to/logs -type f | wc -l`
PERCENTAGE=`echo $INGESTED/$TOTAL_EXPECTED_FILES*100 | bc -l`
echo $INGESTED" / "$TOTAL_EXPECTED_FILES" ( "$PERCENTAGE"% )"

CLI:

$ total=<NUM> done=`find /path/to/logs -type f | wc -l` perc=`echo $done/$total*100 | bc -l`; echo $done" / "$total" ( "$perc"% )"`df -h --output=used /path/to/logs`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment