I have a list of files with a common name pattern, all with the same structure (prefix ave.
):
ave.20050716-12:00:00.stat_profiles.nc
ave.20050816-12:00:00.stat_profiles.nc
ave.20081116-00:00:00.stat_profiles.nc
ave.20120215-12:00:00.stat_profiles.nc
ave.19990316-12:00:00.stat_profiles.nc
ave.20020616-00:00:00.stat_profiles.nc
My question is: How do I remove ave.
from all the files in a file list / folder?
You can use a for
loop and string substitution
for file in ave.*
do
mv "$file" "${file#ave.}"
done
This is just an example to get you started and you should check for things such as already existing files with the name without "ave.".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With