VI:
view               read only mode of vi (:set number <--it wull turn on line numbers)
vedit              beginners version of vi (showmode is on by default)
:set number        turning on/off line numbering
:set ignorecase    turning off case sensitivity when serching
:set noignorecase  turning on case sensivity when serching
(tilde (~) represents empty line)
INPUT MODE:
i        insert text at the cursor
a        append text after the cursor
o        open a new line under the current line
O        open a new line above the current line
r        replace one character where the cursor is (don't need to push i and esc, oly the needed character after the 'r')
R        it allows to overwrite the existing text beginning at the current cursor position
COMMAND MODE:
:q         quits without saving (if no changes have been made, otherwise :q!)
:wq or :x  saves and exits
:w!        saves if the file read only
h        one character left
l        one character right
k        one line up
j        one line down
w        move to the next word
b        back to the previous word
0        move to the beginning of the line
$        move to the end of the line
G        go to the last line
1G       go to the first line
xG       go to the xth line
ctrl-u   go up a page
ctrl-d   go down a page
x        delete a single character
dw       deletes a word
dd       delete the whole line
u        undo the last change
/text    searches for text
n        searches forward for next occurence of the "text"
N        searches backward for previous occurence of the "text"
:%s/word1/word2/g      replaces word1 to word2 in the whole text
:g/word1/s//word2/g    replaces word1 to word2 in the whole text
:!command              executes the command
2 comments:
Hi,
What is the syntax to remove white spaces in AIX VI.
Regards,
Siva
Hi Siva,
white space is also a single character in vi, so you can use 'x' in non-input mode to remove the white spaces
Regards,
Saradhi Peddi
Post a Comment