How to change the default editor when running crontab -e

Mar 17th, 2012 | By | Category: Linux / Freebsd

So you’re sick and tired of editing crontab with an unfamiliar editor are you? Well you’ve come to the right place 🙂

Go into your users home directory, or into /root if you are wanting to change for root (obviously) and edit ~/.bashrc .  Simply add the following line to the bottom of it:

export EDITOR=/usr/bin/vi

or whatever the path to your editor of choice is.  Save the file, exit terminal, re-open terminal and you’re good to go.

Alternatively you can use the following command:

sudo update-alternatives –config editor

But I can’t say I have any idea what this does differently than the method mentioned above, nor do I care to find out.. So if you know the different outcomes of using these 2 methods please feel free to post a comment below.  Thanks

Tags: , , , , ,

Leave a Comment