刚才在一台机器上打开 crontab -e,跳出来的编辑器是nano,太难使...

在debian下是使用 update-alternatives 命令修改默认编辑器。

先查看一下使用帮助

# update-alternatives --help

Usage: update-alternatives [<option> ...] <command>

--config <name>:show alternatives for the <name> group and ask the user to select which one to use.

修改默认编辑器,选择4 /usr/bin/vim.basic

# update-alternatives --config editor
There are 5 choices for the alternative editor (providing /usr/bin/editor). Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/emacs23 0 manual mode
4 /usr/bin/vim.basic 30 manual mode
5 /usr/bin/vim.tiny 10 manual mode Press enter to keep the current choice[*], or type selection number: 4
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode

顺着提示看了一下对应的文件,都是软链接,最终指向 /usr/bin/vim.basic

# ls -l /usr/bin/editor
lrwxrwxrwx 1 root root 24 Dec 8 2015 /usr/bin/editor -> /etc/alternatives/editor
# ls -l /etc/alternatives/editor
lrwxrwxrwx 1 root root 18 Aug 14 15:00 /etc/alternatives/editor -> /usr/bin/vim.basic

另外,可以通过导出变量临时修改编辑器:

export EDITOR="/usr/bin/vim" ; crontab -e

这样,再次打开 crontab -e,跳出来的就是vim了。

最新文章

  1. static关键字作用总结
  2. [原创工具] ListView 调色盘 (Free)
  3. python 培训之爬虫
  4. javascript 的基础笔记
  5. 每日一练(写不出心得体会了!毕竟哪有那么多心得好写。然后看github上有很多不错的题目。分享一下!)
  6. [React Fundamentals] State Basics
  7. PHP中的可变参数函数和可选参数函数
  8. UI标签库的话题:JEECG智能开发平台 BaseTag(样式表和JS标签的引入)
  9. Java使用Schema模式对XML验证
  10. Python实战之列表简单练习
  11. Spring入门(一):创建Spring项目
  12. 英语口语练习系列-C06-购物
  13. Mybatis缓存(1)--------系统缓存及简单配置介绍
  14. java.sql.SQLException: ORA-28040: 没有匹配的验证协议(12c或者12c rac)
  15. centos中安装tomcat6
  16. 简短介绍 C# 6 的新特性
  17. Nginx+IIS部署负载均衡的常见问题
  18. List 集合转换为String
  19. 使用salt-ssh初始化系统安装salt-minion
  20. log4cplus的安装与使用初步

热门文章

  1. linux上网络问题
  2. 【CentOS 7】scp示例
  3. PHP has encountered an Access Violation at 01F4A622解决方法
  4. Docker 私有仓库方案比较与搭建
  5. 关于nodejs中遇到mysql默认8小时连接断开机制的终极简单解决方案
  6. PHP中 post方法 与 get方法 的区别
  7. (第七周)评论alpha发布
  8. java微信开发之接受消息回复图片或者文本
  9. 灵悟礼品网上专卖店Sprint计划
  10. mac下使用marsedit写博客