How to improve the command below to change a string in a filename.
find . -type f -name '*<today>*' -exec mv {} {}_renamed \;
Actually I have a few files in my directory with today's date as a part of the name. I want to change the names of all the files such that only the date string in the file name will be changed to yesterday's date from today's date.
I do not want to put a suffix or prefix to file name instead manipulate the file name.
e.g.
before command file name is xxx20170821yyyy.ppp
after command file name will be xxx20170820yyyy.ppp
and repeat this for all the files which has 20170821
string in theirname.
rename
. You don't even need find then (unless your files are spread over nested directories. If you don't succeed withrename
tell us what you tried. – Philippos Sep 19 '17 at 10:49