因先前一台服务器是debian,默认使用nano作为文本编辑器。后台又上一台服务器装的centos,同事已经习惯了nano,所以决定设置nano作为默认编辑器。

1.安装vim
#yum install nano
2.修改/etc/profile文件,加入
export EDITOR=/usr/bin/nano
3.让/etc/profile文件修改后立即生效 ,可以使用如下命令:
# . /etc/profile
注意: . 和 /etc/profile 有空格
4.运行crontab -e,出现编辑界面,成功.

如果多用户使用,不想影响其他人。就编辑.bashrc文件就好了,不用编辑/etc/profile