dotfiles/.bin/dl-clear
2024-12-12 18:58:31 +01:00

15 lines
291 B
Bash
Executable File

#!/bin/sh
find . -maxdepth 1 \
| grep -v ^.$ \
| grep -v "Telegram" \
| grep -v "Screenshots" \
| grep -v "OLD-"\
| while read file
do
date="$(stat -f "%Sm" -t %Y-%m "$file" )"
[ -f "OLD-$date" ] && mkdir -p OLD-$date
mv "$file" OLD-$date/
done
echo done.