Bash - howinfo/howinfo GitHub Wiki

Moving files

Could also work with other CLI shells.

mv '/some/long/path/to/a/file/you/want/to/rename/'{old,new}

This will expand into both file paths, so you don't need to type the long path a second time. Like this:

mv '/some/long/path/to/a/file/you/want/to/rename/old' '/some/long/path/to/a/file/you/want/to/rename/new'

This will work with any command, of course.