I'm using Bash in vi mode with set -o vi
.
Often I re-run a command but need to change the name of a file in the same directory.
Example:
mv /tmp/myfileA.txt /home/daniel/myfileA.txt
Then, I decide to also move another file:
mv /tmp/w00t.txt /home/daniel/w00t.txt
Typically I press the up-arrow key to get the last command, and press b
until I get to the last slash character, and then insert the new file name. Since I do this very often, I'm wondering if there is an easy way to get the cursor just right after or on the last slash character.
Please note the above is only an example; I know I could do something like mv /tmp/{myfileA,w00t}.txt ...
but often I simply type faster than I think :-)