How to set or change default text editor for crontab in Linux?

To edit the crontab entries you use crontab -e. The command will check for the environment variables $EDITOR or $VISUAL.

So you need to set the  $EDITOR or $VISUAL variable. Let’s learn how to do that.

To Set the default editor to (Vim) for crontab editing

$ export VISUAL=vim

or

$ export EDITOR=vim

Then
$ crontab -e

To set the default editor to (nano) for crontab editing

$ export VISUAL=nano

To set the default editor to (ed) for crontab editing

$ export VISUAL=ed

to exit from ed you need to type q and press enter.

This is how you can set the default editor for crontab in linux.

 

Living in permanent beta mode: Learning, Improving & evolving. SPECIALTIES: Web Application Development, Digital Media, E-Commerce Solutions, SEO, CRM Solutions, Open Source Technologies, System Administration ( Linux ), VOIP Solutions, Cloud Computing, Web Security.

Leave a reply:

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Site Footer