Change & Set the Default crontab Editor

Mar 7, 2011 - 15 Comments


Most hardcore command line users and unix geeks love vi, but I prefer nano. If you want to change your default crontab editor to nano, here’s how to do this:

For a one time edit, launch the terminal and type:

EDITOR=nano crontab -e

If you want to set nano as your default editor in general, you use this command:

export EDITOR=nano

Now when you go to edit crontab, nano will be the default editor than vi. You can test this by typing:

crontab -e

Looking beyond Mac OS X, this should work in Linux as well.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: David Mendez in Command Line, Mac OS X


» Comments RSS Feed

  1. Esj says:

    Thank you. This helped a lot. I don’t care for vi when editing in the terminal. I added this to my bash profile and all is well.

  2. MrMarcie says:

    Thanks for the tip! Very usefull. Love Nano, still not figured out Vi.

  3. nano really? says:

    nano is for idiots who can’t use vi. This is what happens when you put a MAC user in a UNIX shell.

    • Nano4Ever says:

      Actually nano is really easy to use which is why it’s used here and in most other tutorials. Sure vi is powerful and vi is great if you have a month to commit to memory the various keystrokes to interact with vim, but most Mac users have jobs that don’t involve tooling around in vi all day so they don’t get a chance to learn it, and trying to explain vim to the novice is a challenge, a bit like learning mandarin.

      ^esc :wq

  4. W.P. Wily says:

    Thanks, I use nano on a Linux server at work and when I went to do a crontab entry on my home OS X box I was lost with vim :/

  5. axe88 says:

    vi is for neckbeards

  6. capemaster says:

    This set the default editor for the session.
    If you want to make it default, you have to change /etc/bashrc or /etc/profile

  7. Dan Uff says:

    Thank you. I thought I was the only one who used Nano.

  8. Nobody cares says:

    This applies to what, 4 people? Nobody uses this stuff.

Leave a Reply


Shop on and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks


iPhone / iPad



Shop on Amazon to help support this site