How to save and exit crontab -e?

How to save and exit crontab -e?

i tried every method listed here and none works, i have a centos 5, vi comes by default with yum and i installed nano

Solved

just changed the default editor

export EDITOR=nano

and now i can do what I do using nano :) thanks everyone and yes i should learn Vi.. someday!!!


As others have pointed out, the first thing is to make sure you're using an editor you like.

We're all admins here, so we all like vi (ducks, runs).

export VISUAL=vi
crontab -e

(do some edits, finishing with ESCAPE)

:wq

And crontab -l should now show you your new crontab. If you prefer some other editor, set that in the VISUAL environment variable, and exit it as appropriate.


Ctrl+x, answer by pressing y to save changes and Enter to confirm.