[plug] Mass moving files with a script

Timothy White weirdit at gmail.com
Wed Dec 6 10:45:07 WST 2006


>
> Totally untested...

And it showed :p
Try the following

#!/bin/bash
NEW_ROOT="/tmp/new"
for dir in *
        do pushd $dir
        for files in *
                do newdir=`echo $files | cut -d - -f 1`
                mkdir -p $NEW_ROOT/$newdir
                mv -i $files $NEW_ROOT/$newdir/
        done
        popd
done


-- 
Linux Counter user #273956
Don't email joeblogs at scouts.org.au



More information about the plug mailing list