How to make nano or vim as default editor for a crontab file?

steitieh

Well-known member
Joined
Apr 23, 2014
Messages
113
Points
18
I want to open a crontab file using nano editor instead of using vim editor when I run this command "crontab -e". I am not familiar with vim editor, I tried to remember its commands but could not do more.
 

AlbaHost

Well-known member
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
791
Points
43
I want to open a crontab file using nano editor instead of using vim editor when I run this command "crontab -e". I am not familiar with vim editor, I tried to remember its commands but could not do more.
yum install nano

nano /etc/bashrc

add this line at the bottom:

export EDITOR="nano"

Close your current putty session and restart another one and you will be done.
 

Dewlance

Well-known member
Hosting Provider
Registered
Joined
Dec 20, 2014
Messages
115
Points
18
I do not use permanent solution and I prefer temporary command.

Type:
export EDITOR=nano

And then type crontab -e - It will open in nano editor.


I created a alias command, Means instead of typing "export EDITOR=", I created my own alias command and I type only "ex" (without quota) and then I can open cron file in nano editor. You can do this same.
 

HostingWaves

Member
Registered
Joined
Jan 16, 2017
Messages
53
Points
0
In CentOS, by default editor is nano. Also, you can directly edit cron file from /var/spool/cron/user_name_file.
 
Older Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top