1. So if you are editing and you want to check the time or date without exiting vi, you
can enter:
:!date
The time and date will appear on your screen; press ENTER to continue editing at the
can enter:
:!date
The time and date will appear on your screen; press ENTER to continue editing at the
same place in your file.
2. If you want to give several Unix commands in a row without returning to vi editing in
between, you can create a shell with the ex command:
:sh
When you want to exit the shell and return to vi, press CTRL-D .
3. You can combine :read with a call to Unix, to read the results of a Unix command into
your file. As a very simple example:
:r !date
4. :96,99!sort
will pass lines 96 through 99 through the sort filter and replace those lines with the
output of sort.