Cron

How to Make NANO as the Default Text Editor

vi is a full feature text editor but not everyone like it. Some may prefer to use NANO for quick configuration and crontab edits.

Before that, NANO installed in your system.

To change the Default Text Editor to NANO, edit the file as below

nano /etc/profile.d/nano.sh

add the following 2 lines

export VISUAL="nano"
export EDITOR="nano"

Save it!

The changes made won’t take effect on the current session. Log out and log back in to activate the changes.


How to Get NANO or VIM as Text Editor for Crontab

If you want to change Crontab file editor either VIM or NANO instead of using the system default editor, you need to use VISUAL environment variable.

Before that, make sure that VIM or NANO installed in your system if you want to use them.

Specify NANO as the editor for crontab file

export VISUAL=nano; crontab -e

Specify VIM as the editor for crontab file

export VISUAL=vim; crontab -e