At the bash prompt the command history can be explored using the up and down arrow keys. (I also often use CTRL+R.) Is it possible to do this without replacing the character string to the left of the cursor.
For example, I may have found two files using ls:
$ ls ../../blah/foo/bar/CMakeLists.txt
$ ls /usr/include/c++/4.7.2/armv7l-unknown-linux-gnueabihf/bits/c++config.h
I'd now like to shunt the second path into the first file. I begin by pressing the up arrow; then CTRL+A; and removing ls from the start using delete:
$ /usr/include/c++/4.7.2/armv7l-unknown-linux-gnueabihf/bits/c++config.h
I'd now like to use >> to append this path to the CMakeLists.txt file; which I will later edit from within a text editor. The command I'd like to create is:
$ echo /usr/include/c++/4.7.2/armv7l-unknown-linux-gnueabihf/bits/c++config.h >> ../../blah/foo/bar/CMakeLists.txt
It would be nice if I could scroll interactively through the history to locate the CMakeLists.txt path while leaving the .../c++config.h part untouched.
One possibility would be to use !! and !-N event designators, but if possible I'd much prefer something interactive; such as the up and down arrows; or CTRL+R.