New to linux :-)
In my .bashrc I have set -o vi
.
That way when I'm in the terminal I can press CTRL +{ and then use VI commands to navigate, edit and search the command history.
One thing I cannot figure out is how to find and replace. Let's say for example, I have the following command cp /abc/*.src /def/*.src
. How can I find/replace src
with trg
?
To clarify, I'm NOT in the VI/VIM editor. I'm on the command-line. For example, on the command-line to access the last command, i can do the following:
CTRL +{ k
Then to append to the end of command I can do:
$ a
How can I change my command using find/replace on the command-line.
Thanks
vi
(in title, tags, ...) as time as you want find/replace on the history command-line?