for i in logfilename.*.gzThe argument -r to date(1) command tells it to use the last modification date (mtime) of a file given as the argument to the option. Note that it is also possible to use stat(1) command instead of date(1).
do
mv -i $i logfilename.`date -r $i +%Y%m%d`.gz
done
No comments:
Post a Comment