Skip to content

Instantly share code, notes, and snippets.

@jupegarnica
Created December 2, 2020 07:53
Show Gist options
  • Save jupegarnica/99cf82f94024bdfd833c5d8850c88b03 to your computer and use it in GitHub Desktop.
Save jupegarnica/99cf82f94024bdfd833c5d8850c88b03 to your computer and use it in GitHub Desktop.
#!/bin/bash
# FILES=./files/*
TARGET=./new # make sure that folder exists!
COUNTER=1 # if you want to start from 0, just put 0 there
for f in $(ls -t files/*)
do
echo "Processing $f file..."
mv -i $f $TARGET/$COUNTER"___"${f##*/}
let "COUNTER++"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment