How can I get the current date in YYYY-MM-DD format in (OS X) bash?
Try
cp myfile.ext myfile.`date "+%Y-%m-%d"`.ext
and for a proper solution, decompose the name first into basename and extension, assign the date and then reassemble for final targetname.
The key is that
date +FORMAT
allows for very rich format strings. See date --help
or the rather fine manual.
cp myfile.ext myfile.`date +%Y-%m-%d`.ext
or use shorthand format
date +%F