Peter Hardy wrote:
Peter Hardy wrote:
for file in `ls`; do
date=`ls -l --time-style=long-iso "$file" | awk '{ print "$6 $7" }'
newname=`date -d "$date" +%Y%m%d%H%M`
mv "$file" $newname
Er, that should be awk '{ print $6" "$7 }'
* Only partially tested. Your mileage liable to variance.
...told you so.
What if you have two files with the same timestamp.
What do you wish to happen?
-rw
--
_________________________________
Rick Welykochy || Praxis Services
The 7 R's of Windows support: retry, restart, reboot, reconfigure,
reinstall, reformat and finally, replace with Linux.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html