Created
October 27, 2021 21:05
-
-
Save JeanOlivier/53838e08b5e59dc9af52e67fdc320959 to your computer and use it in GitHub Desktop.
Get the total size of files with a specific extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change the ./ and ".jpg" part to your own needs. | |
# The `| numfmt --to=si` part get human readable output, remove it to get a number of bytes. | |
find ./ -type f -name "*.jpg" -printf "%s\n" | gawk -M '{t+=$1}END{print t}' | numfmt --to=si |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment