Shell – UNIX move file name with sysdate

daterenameshell-script

I want to make a script in Unix in which I have to move a file daily to a specific path.
In order to avoid overlapping of the file, I want the file name along with the date.

e.g. mv filename /home/bin.
How can I add the date to the file name?

Best Answer

mv "filename.ext" "/home/bin/filename-$(date +%Y%m%d).ext"
Related Question