CLI Usage
7950 SR OS Basic System Configuration Guide
Page 47
EX Commands
The
vi
editor is built upon another editor, called EX. The EX editor only edits by line. From the
vi
editor you use the
:
command to start entering an EX command. This list given here is not
complete, but the commands given are the more commonly used. If more than one line is to be
modified by certain commands (such as
:s
and
:w
) the range must be specified before the
command. For example, to substitute lines 3 through 15, the command is
:3,15s/from/this/g
.
Table 15: EX commands
vi Command
Description
:ab string strings
Abbreviation. If a word is typed in
vi
corresponding to string1, the editor
automatically inserts the corresponding words. For example, the
abbreviation
:ab usa United States of America
would insert the
words,
United States of America
whenever the word
usa
is typed
in.
:map keys
new_seq
Mapping. This lets you map a key or a sequence of keys to another key or
a sequence of keys.
:q
Quit
vi
. If there have been changes made, the editor will issue a warning
message.
:q!
Quit
vi
without saving changes.
:s/pattern/
to_pattern/
options
Substitute. This substitutes the specified pattern with the string in the
to_pattern. Without options, it only substitutes the first occurrence of the
pattern. If a 'g' is specified, then all occurrences are substituted. For
example, the command
:1,$s/Alcatel/Alcatel-Lucent/g
substitutes all occurrences of
Alcatel
to
Alcatel-Lucent
.
:set [all]
Sets some customizing options to
vi
and EX. The
:set all
command
gives all the possible options.
:una string
Removes the abbreviation previously defined by
:ab
.
:unm keys
Removes the remove mapping defined by
:map
.
:vi filename
Starts editing a new file. If changes have not been saved, the editor will
give you a warning.
:w
Write out the current file.
:w filename
Write the buffer to the filename specified.
:w >> filename
Append the contents of the buffer to the filename.
:wq
Write the buffer and quit.
Содержание 7950 XRS Series
Страница 8: ...Page 8 7950 SR OS Basic System Configuration Guide List of Tables...
Страница 10: ...Page 10 7950 SR OS Basic System Configuration Guide List of Figures...
Страница 14: ...Preface Page 14 7950 SR OS Basic System Configuration Guide...
Страница 46: ...VI Editor Page 46 7950 SR OS Basic System Configuration Guide...
Страница 76: ...File Management Tasks Page 76 7950 SR OS Basic System Configuration Guide...
Страница 78: ...File Command Reference Page 78 7950 SR OS Basic System Configuration Guide...
Страница 92: ...Basic Command Reference Page 92 7950 SR OS Basic System Configuration Guide show system candidate...
Страница 172: ...Basic CLI Commands Page 172 7950 SR OS Basic System Configuration Guide...
Страница 184: ...Configuration Notes Page 184 7950 SR OS Basic System Configuration Guide...
Страница 214: ...DNS Configuration Commands Page 214 7950 SR OS Basic System Configuration Guide...
Страница 220: ...Show Commands Page 220 7950 SR OS Basic System Configuration Guide...
Страница 494: ...System Commands Page 494 7950 SR OS Basic System Configuration Guide...
Страница 500: ...Standards and Protocols Page 500 Standards and Protocols...
Страница 502: ...Index Page 502 7950 SR OS Basic System Configuration Guide system parameters 252 system time elements 256 timing 294...