LinuxMoz

Linux Stuff && Coffee

How to Change Crontab Editor

| Comments

By default on Linux based systems Vi is used to edit the crontab, some of you might prefer Emacs (shame on you) and some others might even prefer to use Nano or Pico (no comment). Regardless of your reason not to use Vi for editing your crontab (I can’t think of any?), here are the instructions on how to change the crontab default editor in Linux (any version, Ubuntu, CentOS, Debian etc).

Set Nano as the default crontab Editor

Note, this will also change the default editor for a number of other commands.

Set Nano as the default editor in Linux:

1
export EDITOR=nano

Set vi as the crontab editor

Note, this will also change the default editor for a number of other commands.

Set Vi as the default editor in Linux:

1
export EDITOR=vi

Set Emacs as the crontab editor

Note, this will also change the default editor for a number of other commands.

Set Emacs as the default editor in Linux:

1
export EDITOR=emacs

Now when you type “crontab -e” it should load up with your editor of choice, if it does not you might need to specify the full path to the editor (depending on what shell you are using).

Comments