If you configure your .bashrc file to use the vi editor
at the command line it will make command line edits so much less complex.
1st, once "set -o vi" is enabled, you can simply hit "<esc> k",
then keep hitting "k" to go up the history file as it were,
if you go past an entry, use "j" to go down.
NOTE: when using vi, there are two modes: command and edit
to enter the command mode hit the ESCAPE KEY ONCE,
then a,A,i,I, etc. to insert.
Simple cursor pad in vi: left=h, down=j, up=k, right=l
I've added all the entries needed to make this work at:
So, based on the very helpful information above,
I was able to use "history" and RECALL a line from "history", WITHOUT executing it. (THANK YOU FOR THAT POST!)
if shopt is listed and
histverify is "off" a ! will EXECUTE immediately,
if you've added to your .bashrc, or typed: shopt -s histverify,
then a ! allows an edit, for example:
1 more .bashrc
4 . ./.bashrc
5 shopt | grep hist
when I hit !5 the following command appears, but does NOT execute
### if histverify is "on".
shopt | grep hist
Remember that Linus and Richard created Linux and GNU tools
to take advantage of UNIX. The vi editor (created by Bill Joy)
is one of the best tools to master as it is on EVERY distribution of UNIX
All of the other command line editors need to be loaded and
require additional software. Using a GUI in Linux
(other than Firefox, Thunderbird, and OpenOffice)
is like towing your Diesel 4x4 with a 1968 VW Beetle...
it'll work, but it sure doesn't make any sense.
Remember what Kernigan said about a GUI, "what you see is all you get".