ex [options] filesA line-oriented text editor; a superset of ed and the root of vi. See Chapter 8 and Chapter 9 for more information.
-c commandBegin edit session by executing the given ex command (usually a search pattern or line address). If command contains spaces or special characters, enclose it in single quotes to protect it from the shell. For example, command could be ':set list' (show tabs and newlines) or /word (search for word) or '$' (show last line). (Note: -c command was formerly +command. The old version still works.)
-lRun in LISP mode for editing LISP programs.
-LList filenames saved due to an editor or system crash.
-r fileRecover and edit file after an editor or system crash.
-REdit in read-only mode to prevent accidental changing of files.
-sSuppress status messages (e.g., errors, prompts); useful when running an ex script. (-s was formerly the - option; the old version still works.)
-t tagEdit the file containing tag and position the editor at its definition (see ctags for more information).
-vInvoke vi. Running vi directly is simpler.
-VVerbose; print nonterminal input on standard error. Useful for tracking shell scripts running ex.
-wnSet the window size to n. Useful over slow dial-up (or slow Internet) connections.
-xSupply a key to encrypt or decrypt file using crypt.
-CSame as -x, but assume that file began in encrypted form.
Either of the following examples applies the ex commands in exscript to text file doc:
ex -s doc < exscriptcat exscript | ex -s doc