I find myself frequently needing to rename different files with mv
that are in deep directories:
mv /a/long/path/to/a/file.txt /a/long/path/to/a/file.txt.bak
But I don't want to retype the full path name. Is there a quick shorthand or alias that I could use? I.e.:
$ mv /a/long/path/to/a/file.txt file.txt.bak
$ ls /a/long/path/to/a/file.txt.bak
a/long/path/to/a/file.txt.bak
(note: this is for straightforward, single file renames in different directories at different times, not for mass-renames)