[ Home ] Passports | National Anthems in MP3 | Live chat

Live chat

News | Forum
 

Train Museum:

Warsaw, PolandSeoul, KoreaKyoto, Japan Forums: Rail UK, Rail Australia
Pictures: MoneyMonorailHong Kong light festival High speed trainQueen Elizabeth II in YokohamaTaro - Galapagos Tortoise



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.

Tuxedo


231439. Re: Confounded by conditional expressions 231439
231440. Re: Confounded by conditional expressions 231440
231441. Re: Confounded by conditional expressions 231441
231442. Re: Grep multi-line 231442
231443. Re: Confounded by conditional expressions 231443
231444. Re: Confounded by conditional expressions 231444
231445. Re: Grep multi-line 231445
231446. Re: Confounded by conditional expressions 231446
231447. Availables : More that 3500 Solutions manuals and Test Banks (Part 1)
231448. Availables : More that 3500 Solutions manuals and Test Banks (Part 2)
231449. Availables : More that 3500 Solutions manuals and Test Banks (Part 3)
231450. Question about shift and remains value 231450
231451. Re: Question about shift and remains value 231451
231452. Re: Grep multi-line 231452
231453. Re: Grep multi-line 231453
231454. Re: Question about shift and remains value 231454
231455. See Hot College Girls Latest . Videos. 231455
231456. can i duplicate stdin to stdout? 231456
231457. Re: Grep multi-line 231457
231458. Re: Grep multi-line 231458