Editing the Crontab File with vi
Please use the “Print” function at the bottom of the page to create a PDF.
For Linux Web Hosting packages and Managed Dedicated Servers
When the crontab -e command is used, the vi editor opens. This editor has a command mode and an insert mode.
In command mode, you can enter commands, such as saving the file. Keystrokes in this mode do not appear as text on the screen, but are interpreted as commands.
You can access the insert mode by entering an appropriate command. In most cases, this is the i (insert) or insert key. In this mode, the characters you enter are immediately inserted into the text editor. To enter the command mode, press the ESC key.
Here are some common commands:
Command | Description |
---|---|
dd | Delete current line |
u | Reverse last change |
x | Delete character under the cursor |
j | Merge lines |
o | Insert a new line under the current one |
p | Insert data from the memory buffer at the cursor position |
q | Quit the editor without saving the text. |
wq | Write the changes to the file and quit the editor |
i | Switch to input mode, in order to add and edit text |