Subject: Re: Directory creation and file moving by modification dates?
Posted on: Fri, 30 Jul 2010 14:19:53 +0200
pk wrote:
[...]
> Something like (assuming you have GNU stat)
>
> cd /photo/dir
>
> for f in *.jpg; do
>
> ymd=$(stat -c %y "$f")
> ymd=${ymd%% *}
>
> if [ ! -d "${ymd}" ]; then
> mkdir "${ymd}"
> fi
>
> mv -- "$f" "${ymd}"
>
> done
>
Many thanks for this script snipped! I will try it.