Multi rename in Linux bash
I trying to rename my file(date yesterday)1, file(date yesterday)2,3,4,5... using this code.
#!/bin/bash echo dir date? read datedir cd /mnt/c/Users/OPS\ 1/Desktop/F/CVS/CVS\ COMPONENTS/CVS$datedir echo date now? read datetd echo last date? read lastdate rename -v 's/$lastdate/$datetd/g' *$lastdate
man renameI see what you are trying to do:
renamecommand is used wrong. Update it with the following:
rename "$lastdate" "$datetd" *$lastdate
rename from to file...
renamewill rename the specified files by replacing the first occurrence of
fromin their name by