Linux ex Command
The Linux ex command is used to start the vim text editor in Ex mode.
ex works like vi -E; its syntax and parameters can be referenced from the vi command. To return from Ex mode to normal mode, simply type ":vi" or ":visual" in vim.
Syntax
ex [选项][参数]
Parameter Description:
- -b: edit files in binary mode
- -c command: execute the specified command after editing the first file
- -d: show the differences when editing multiple files
- -m: do not allow file modification
- -n: do not use a cache
- -oN: where N is a number
- -r: list caches and display recovery information
- -R: open files in read-only mode
- -s: do not display any error messages
- -V: display the detailed execution process of the command
- --help: display help information
- --version: display version information
Example
After typing a file name following the ex command and pressing Enter, you enter ex editing mode. For example, to edit the file testfile, use the following command format:
ex testfile
The output information is as follows:
"testfile" 5L, 95C
"testfile" indicates the file name, 5L indicates 5 lines, and 95 indicates the byte count
Enters ex mode. Type "visual" to return to normal mode
Its operation is the same as in vim. At this point, if you type "visual" after the ":" and press Enter, you will enter the full-screen interface of the vi command; if you type "q", you will exit the editor.
Linux Command Reference