Link to home
Start Free TrialLog in
Avatar of Georges Orwell
Georges OrwellFlag for France

asked on

[bash] complex renaiming file

Hi all,

I have to  rename some files  as following

varnishSEO1-ddmmyyyy.log to varnishSEO2.log-yyyymmdd

Is there a rapid way to do this?

Thanks for your help
ASKER CERTIFIED SOLUTION
Avatar of Abhimanyu Suri
Abhimanyu Suri
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Georges Orwell

ASKER

Thanks
It works partially.

It return me

varnishSEO1.log-20170414
varnishSEO1.log-20170415
varnishSEO1.log-20170416
varnishSEO1.log-20170417
varnishSEO1.log-20170418
varnishSEO1.log-20170419
...

but I can do something like this to finish

for file in $(ls varnishSEO*); do mv $file ${file//SEO1/SEO2} ; done

I will test it