This requires us to bring out something different from our Unix arsenal - the "rename" command!
Use the rename command in conjunction with find to rename multiple files:
find /source_folder/to/search/in/ -name 'myapp*.log.201*' -exec rename -v .log. .oldlog. {} \; >> /temp/rename.log
Here we are searching for files named 'myapp*.log.201*' and renaming them to 'myapp*.oldlog.201*'
In case you need to do this on multiple servers, use the for loops trick!
1 comment:
I have bookmarked your website because this site contains valuable information in it. I am really happy with articles quality and presentation. Thanks a lot for keeping great stuff. I am very much thankful for this site.
unlock pdf file
Post a Comment