Tag: crontab editing

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

    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.