I have 365 files named
MOD11A1.A2010001.h24v06.006.2016025150444.hdf
MOD11A1.A2010002.h24v06.006.2016025151748.hdf
MOD11A1.A2010003.h24v06.006.2016025163706.hdf
and I want to rename these files as:
modis1.hdf
modis2.hdf
modis3.hdf
I am using the mv
command separately for each file to rename them.
How do I achieve this in one go?
Best Answer
Since you only care about the
A2010...
bit, usingrename
in the directory with the files:Example:
Run without
-n
to actually rename the files.