Skip to content

Instantly share code, notes, and snippets.

View Saleh7's full-sized avatar
✈️
I'm flying!

~/Saleh Saleh7

✈️
I'm flying!
View GitHub Profile
@darth-veitcher
darth-veitcher / useful-linux-filesystem-commands.md
Created October 27, 2017 08:00
useful linux filesystem commands
# Archive content which hasn't been modified within the last 6months
find . -mtime +180 | while read -r name; do rsync -rLvPz --remove-source-files "$name" rsync://homenas/Backups/hd/; done

# Delete folders which have contents < 50kb
find /path/to/root/folder -mindepth 1 -maxdepth 1 -type d -exec du -ks {} + | awk '$1 <= 50' | cut -f 2- | xargs -d \\n rm -rf