Skip to content

Instantly share code, notes, and snippets.

@GuyPaddock
Last active December 14, 2021 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GuyPaddock/dd5ce0c1775f1fe9ddcd0c4c40dd4d10 to your computer and use it in GitHub Desktop.
Save GuyPaddock/dd5ce0c1775f1fe9ddcd0c4c40dd4d10 to your computer and use it in GitHub Desktop.
Get sizes of files in a folder in CSV format
#!/usr/bin/env bash
echo "filename,size_bytes"
find "${1}" -type f | while read filename; do
stat --format="%n,%s" "${filename}";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment