Friday, 7 October 2016


A dirty one liner as a small reminder for myself. Oh well, it did help my client to get those images out of this rotten old CMS quickly. And it wasn't as dirty as what people in #bash suggested. Dirty? Not dirty at all!

find ./ -iname "*image_large" -print0 | xargs -0 bash -c 'for image; do mv "$image" "$(dirname "$(dirname "$image")")"/$RANDOM.jpg; done' bash


Paul Cobbaut said...

Why is there a 'bash' at the end ?

Mark Van den Borre said...

Paul, .