Shell Bash Script Find and Move


(Raghu125coorg) #1

I have the script writte to recursively find and copy files to a desired location

#!/bin/bash

a script to recursively find and copy files to a desired location

find /path/xml -type f -iname ‘*.XML’ -print0 |

while IFS= read -r -d ‘’ f;

do cp – "$f" /path/www/sites/default/files/xml ;

done

Now i want to find the latest Zip file inside the folder, unzip it and move the new file to another folder in the same system,

renaming it to Current date.