I have list of files and each file name ends with (+1) and I want to replace that (+1) of the filename with date
Ex: ABC.DEF(+1)
ABC.DEF(+1)
Looking for a simple solution which replaces the file name as below:
ABC.DEF.20200127
I am not sure about the extension of your file, so I just considered .txt
for file in *.txt; do mv "$file" "${file%????.txt}."`date +"%y%m%d"`"" done
2.1m questions
2.1m answers
60 comments
57.0k users