Linux ex Command
The Linux ex command is used to start the vim text editor in Ex mode.
ex operates similarly to vi -E, and its syntax and parameters can be referenced from the vi command. To return from Ex mode to normal mode, enter ":vi" or ":visual" in vim.
Syntax
ex [options][arguments]
Parameter Description:
- -b: Edit file in binary mode
- -c command: Execute the specified command after editing the first file
- -d: When editing multiple files, display the differences
- -m: Disallow modifications to the file
- -n: Do not use swap files
- -oN: Where N is a number
- -r: List swap files and display recovery information
- -R: Open file in read-only mode
- -s: Do not display any error messages
- -V: Display detailed execution process of the command
- --help: Display help information
- --version: Display version information
Example
After entering the ex command followed by the filename and pressing Enter, you can enter the ex editing mode. For example, to edit the testfile, use the following command format:
ex testfile
The output information is as follows:
"testfile" 5L, 95C
"testfile" represents the filename, 5L represents 5 lines, and 95 represents the number of bytes.
Enter ex mode. Enter "visual" to return to normal mode.
Its operations are the same as in vim. If you enter "visual" after ":" and press Enter, you will enter the full-screen vi interface; if you enter "q", you will exit the editor.