A short interactive solution two steps solution:
foo/bar/poit/zoid/narf.txt avaylable for the Alt-. shortcut in bash.
mv and hit Alt-., Space, Alt-.
You will get
mv foo/bar/poit/zoid/troz.txt foo/bar/poit/zoid/troz.txt.
Now you can modify the last word easily.
A tool, which might come (very) handy is:
Midnight Commander - a file manager running in the console. It gives you the possibility to copy filenames and directory paths interactively into the command line. Midnight commander shows you therefor 2 panels (left and right), which list the content of different directories.
A short guide:
- Up Down arrow keys select files in the current panel.
- Tab switches between left and right panel.
- Ctrl-Shift-Enter copies the currently selected file to the command line (including full path)
- Alt-o opens the currently selected directory in the other panel
- Ctrl-o lets you see the console in full screen
- Ctrl-xp copies the path of the active panel into the console
- Ctrl-xCtrl-p copies the path of the inactive panel into the console
- Esc-Tab is auto completion
This is by far the fastest way I found so far - after one got used to the shortcuts.