Linux ex command

Linux 命令大全Linux Command Reference

The Linux ex command is used to start the vim text editor in Ex mode.

ex works the same as vi -E. Its usage syntax and parameters can refer to the vi command. To return from Ex mode to normal mode, enter ":vi" or ":visual" in vim.

Syntax

ex [选项][参数]

Parameter description:

    +number: Start displaying from the specified line number of the file
  • -b: Edit the file in binary mode
  • -c command: Execute the specified command after editing the first file
  • -d: When editing multiple files, display the differences
  • -m: Do not allow modifying the file
  • -n: Do not use cache
  • -oN: Where N is a number
  • -r: List the cache and display recovery information
  • -R: Open the file 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

Examples

After entering the file name after the ex command and pressing Enter, you will enter ex edit mode. For example, to edit the testfile file, the command format is as follows:

ex testfile 

The output information is as follows:

"testfile" 5L, 95C 

"testfile" indicates the file name, 5L means 5 lines, and 95 means the number of bytes

Enter ex mode. Type "visual" to return to normal mode

Its operations are the same as in vim. At this point, if you type "visual" after ":" and press Enter, you will enter the vi command full-screen interface; if you type "q", you will exit the editor.

Linux 命令大全Linux Command Reference

Other Extensions