find: пример выполнения нескольких команд

find . -ctime -60 -maxdepth 1 -type f | while IFS= read x
 
do
    gzip
-9 "$x"  # compress it
    D
=${x%%.csv}  
    D
=${D/-*/}    # remove suffix and everything after the -

    mkdir
-p "$D" # create dest sub folder
    mv $x
.gz "$D"   # move it
done

Comments powered by CComment

Designed by san © 2018