Most command names are English words, and initial prefixes of the words are acceptable abbreviations. The ambiguity of abbreviations is resolved in favor of the more commonly used commands.*
Most commands accept prefix addresses specifying the lines in the file upon which they are to have effect. The forms of these addresses will be discussed below. A number of commands also may take a trailing count specifying the number of lines to be involved in the command.** Thus the command ``10p'' will print the tenth line in the buffer while ``delete 5'' will delete five lines from the buffer, starting with the current line.
Some commands take other information or parameters, this information always being given after the command name.***
A number of commands have two distinct variants. The variant form of the command is invoked by placing an `!' immediately after the command name. Some of the default variants may be controlled by options; in this case, the `!' serves to toggle the default.
The characters `#', `p' and `l' may be placed after many commands.** In this case, the command abbreviated by these characters is executed after the command completes. Since ex normally prints the new current line after each change, `p' is rarely necessary. Any number of `+' or `-' characters may also be given with these flags. If they appear, the specified offset is applied to the current line value before the printing command is executed.
It is possible to give editor commands which are ignored. This is useful when making complex editor scripts for which comments are desired. The comment character is the double quote: ". Any command line beginning with " is ignored. Comments beginning with " may also be placed at the ends of commands, except in cases where they could be confused as part of text (shell escapes and the substitute and map commands).
More than one command may be placed on a line by separating each pair of commands by a `|' character. However the global commands, comments, and the shell escape `!' must be the last command on a line, as they are not terminated by a `|'.
Most commands which change the contents of the editor buffer give feedback if the scope of the change exceeds a threshold given by the report option. This feedback helps to detect undesirably large changes so that they may be quickly and easily reversed with an undo. After commands with more global effect such as global or visual, you will be informed if the net change in the number of lines in the buffer during this command exceeds this threshold.