How to rename a file inside a folder using a shell command?
- by Leonid Shevtsov
I have a file at some/long/path/to/file/myfiel.txt.
I want to rename it to some/long/path/to/file/myfile.txt.
Currently I do it by
mv some/long/path/to/file/myfiel.txt some/long/path/to/file/myfile.txt
, but typing the path twice isn't terribly effective (even with tab completion).
How can I do this faster? (I think I can write a function to change the filename segment only, but that's plan B).