How can I write a script to copy files from one directory to another directory according to last modified date?
ls -al
-rw-r--r-- 1 user user 100 2011-05-26 12:33 ABC1234_frontcover_10344000_2011-05.doc
What exactly I want to do is, Using the above bold part of ls -al result the ABC1234_frontcover_10344000_2011-05.doc
file should be copied to /home/abcd/ABC1234/2011-05/26/
.
There should be some way to do it using value of date -r $file +%m
and basename *.doc | awk -F_ '{print $1}'
. Help me here, how?