Stop typing the filename twice. Brace expansion handles it.
Stop typing the filename twice. Brace expansion handles it. Works on any file, any extension.
#Instead of
cp config.yml config.yml.bak
#Do
cp nginx.conf{,.bak}
cp .env{,.bak}
cp Makefile{,.$(date +%F)}
# That last one timestamps your backup automatically. You're welcome.
Posted Feb 21, 2026, 5:32 PM UTC
46980