Created
December 15, 2017 08:37
-
-
Save filipsPL/d4dcc69d16c16d9afc8f16be3edc1480 to your computer and use it in GitHub Desktop.
List files bigger than the given size and optionally compress them
This file contains 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
#!/bin/bash | |
### list files bigger than the given size | |
### and optionally compress them | |
filesize=100M # files bigger than this will be listed; default is 100M | |
for f in `find . -type f -size +$filesize` | |
do | |
du -sh "$f" | |
## gzip "$f" # compress each big file | |
done | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment