How do i rename all the files using a script ?
My server create log files and save them with numbering behind the name. for e.g. daily_20080101.log.0001 and so on ... How do a script and crontab it to remove all the numbering? Please help thanks.
for f in daily*
do
echo mv $f ${f%.[0-9]*}
done
Take out the echo when you have finished testing it...
Be careful though because daily_20080101.log.0001 will be overwritten by daily_20080101.log.0002 if it is also present?
omg, it works! thanks Annihilannic ....