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).(do some edits, finishing with ESCAPE)
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.To exit vi editor:
Usually the new or modified file is saved when you leave vi. However, it is also possible to quit vi without saving the file. The cursor moves to bottom of screen whenever a colon (:) is typed.
Ctrl+x, answer by pressing y to save changes and Enter to confirm.
esc
-esc
-:wq
? Are you saying vi is the default editor, and you want nano instead?Saving and quitting vi is outlined here: http://www.helpdesk.umd.edu/documents/4/4793/#a13
If your crontab -e is runned in the joe-editor, try:
CTRL+c to exit without saving changes
CTRL+k+x to save and exit