I commonly backup config files on servers without version control like so:
# cp httpd.conf{,.bak}
# ls
httpd.conf httpd.conf.bak
However, for files in the web root I take the time to carefully put the .bak before the filename extension so that the .php will remain and Apache will still send the file through the PHP interpreter if someone manages to guess or probe the server for such files:
$ cp index.php index.bak.php
$ ls
index.php index.bak.php
Is there any way to use tab-completion and muscle memory to put the .bak before the filename extension? I have Tab{}←,.bak burned into muscle memory and I cannot use this nice "meat macro" on files in the web root.
Thanks.