Basically you have a vi-editor with only one line visible (and the history-file as text open) at the commandline. (Almost) every vi-command will work on the commandline too:
ESC (to set the editor from insert- to command-mode) and then:
k - a line up (therefore: last command)
j - a line down (therefore: next command, if you have already gone back some)
l - move cursor a character right
h - move cursor a character left
w - move cursor to first character of the word right to the cursor
b - move cursor to first character of the word left to the cursor
W/B - same as w/b but only taking whitespace as word boundaries into consideration
This means: let text be "abc/def/ghi". If the cursor is on "g", then "w" brings you to the third "/", the next "w" to "d", etc., while "W" brings you to "a".
0 - move to first character in the line
/ - search through command history (all regexps allowed)
n - repeat last search and go to next hit
N - repeat last search and go to previous hit
i - reenter insert mode
a - append: insert right after cursor position
A - append at end of line
v - open a full vi with the command line as text (saving & exiting executes the command)
# - put a comment sign in front of the command and put it into history
This won't execute anything, but saves a command(-part) for future use in the history file.
I hope this helps.
bakunin
Last edited by bakunin; 05-27-2010 at 10:02 PM..
These 3 Users Gave Thanks to bakunin For This Post:
I try to use the pattern substitution operators as documented in the O'Reilley "Learning the Korn Shell" but it doesn't seem to work as advertised.
This works all right:
var='Regular expressions rules!'
$ echo ${var//e/#}
R#gular #xpr#ssions rul#s!
The docs says that using !(expr)... (5 Replies)
HI ,
I forgot to redirect my op to a file.The op which is quite huge , thus printed on the screen.However bcoz of the limited viewing in the screenI can not see the whole of the output..
Is there anyway I can see the full op.My run takes half a day for finnishing ..So I am refraining... (1 Reply)
on a AIX sys i have been trying to get the mouse scroll wheel to page the terminal for about 2 yrs now on aixterm. any ideas. the below syntax does not work in aixterm but does work in xterm.
------------------------- this does not work in aixterm but does work in xterm,, with a cat Xdefult |... (2 Replies)
Sorry for the duplicate thread this one is similar to the one in
https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121
Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
I don't have my SysV bible with me currently and I can't remember how to change the amount of lines visible in my shell. Currently I can only scroll back to see the last 100 lines of stdout.
Any help is greatly appreciated.
blessings,
Tony <>< (2 Replies)
I figured this would be simple, but I am stuck.
Variable longpath="/dir1/dir2/dir3/filename.stuff.morestuff.garbage"
I want to end up with just "filename.extra.moreextra". So, I want to get rid of the path and .garbage
I want to do this with just ksh internals. So, no sed,grep,awk,expr,... (4 Replies)
I have the need to check content of very many files for a block of text.
I know the data should match for instance/as an example the following
The list of characters
bugs bunny
tom and jerry
Mighty mouse
Felix the cat
/
In the first step, I isolated the interesting data by... (3 Replies)
Hello,
I am a beginner, I have currently Solaris 11 on a vmware machine. Whenever I type a command like 'ls' the screen scrolls to the end of the screen. I am unable to see the entire list of directories and files. I have tried ls |page command, but looking out for a better option. (3 Replies)