Using nano to edit the cron

On my first web server (CentOS), when I edited my cron it opened up using nano. Unfortunately my second web server, again CentOS, opened the cron using vi. To setup nano as the default editor for your cron, you can do the following

export EDITOR=nano

Of course you could use any editor as your default, but I like nano.

You can do this once every session, or you can add it into your login script and you never need to type it in again.

Edit a text file in Linux using nano

A lot of hardcore Linux users will use vi to edit a text file via a Linux shell. Personally I find that scary and have no idea what I am doing. Instead, I use nano, which is fairly straight forward to use. I use centos and that has nano installed by default, but if you have to install it, i’m sure a quick Google will help out.

nano filename

that’s it. simple.