So, in many situations I wanted a way to know how much of my disk space is used by what, so I know what to get rid of, convert to another format, store elsewhere (such as da
I suggest something like: find . -regex '.*\.bak' -print0 | du --files0-from=- -ch | tail -1
Some notes:
-print0 option for find and --files0-from for du are there to avoid issues with whitespace in file names./dir1/subdir2/file.bak, not just file.bak, so if you modify it, take that into accounth flag for du to produce a "human-readable" format but if you want to parse the output, you may be better off with k (always use kilobytes)tail command, you will additionally see the sizes of particular files and directoriesSidenote: a nice GUI tool for finding out who ate your disk space is FileLight. It doesn't do regexes, but is very handy for finding big directories or files clogging your disk.