ubuntu nano_在Ubuntu Linux上从Nano更改默认编辑器

ubuntu nano

ubuntu nano

Many of the utilities in Ubuntu Linux use a text editor to allow you to edit configuration options and files. An example of this is using the crontab command, which allows you to edit your cron jobs using the default editor.

Ubuntu Linux中的许多实用程序都使用文本编辑器来允许您编辑配置选项和文件。 例如,使用crontab命令,该命令允许您使用默认编辑器编辑cron作业。

It’s really easy to set the default editor using the update-alternatives command. Open up a terminal window and type in the following command:

使用update-alternatives命令设置默认编辑器确实很容易。 打开一个终端窗口,然后输入以下命令:

sudo update-alternatives --config editor

sudo update-alternatives --config editor

Here’s an example of what you’ll see:

这是您将看到的示例:

$ sudo update-alternatives –config editor

$ sudo update-alternatives –配置编辑器

There are 5 alternatives which provide `editor’. Selection Alternative ———————————————– 1 /usr/bin/vim 2 /bin/ed *+ 3 /bin/nano 4 /usr/bin/vim.basic 5 /usr/bin/vim.tiny Press enter to keep the default[*], or type selection number:

提供“编辑器”的有5种选择。 选择选项———————————————– 1 / usr / bin / vim 2 / bin / ed * + 3 / bin / nano 4 /usr/bin/vim.basic 5 / usr / bin / vim.tiny按Enter键保留默认值[*],或输入选择编号:

You can select the editor you want by just typing in the number. For example, if I want to change the default editor to vim, I would just hit the number 1.

您只需输入数字即可选择所需的编辑器。 例如,如果我想将默认编辑器更改为vim,则只需按数字1。

You can test this out by typing in crontab -e to edit your cron file. You should see the editor that you chose, instead of the default.

您可以通过键入crontab -e来编辑cron文件来进行测试。 您应该看到选择的编辑器,而不是默认的编辑器。

翻译自: https://www.howtogeek.com/howto/ubuntu/change-the-default-editor-from-nano-on-ubuntu-linux/

ubuntu nano

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值