2015年9月5日 星期六

[Linux 常見問題] Change the Default Editor From Nano on Ubuntu Linux

Source From Here 
Question 
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. 

How-To 
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: 
$ sudo update-alternatives --config editor

Here’s an example of what you’ll see: 
$ sudo update-alternatives --config editor

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:

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. 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.

沒有留言:

張貼留言

[JS 文章收集] 用 Node.js 學 JavaScript 語言(1)簡介與安裝

Source From  Here   簡介   Node.js  是 Ryan Dahl 基於 Google 的 V8 引擎於 2009 年釋出的一個 JavaScript 開發平台,主要聚焦於 Web 程式的開發,通常用被來寫網站。但是,要開發網站就勢必要把「 HTML,...