How to set default on Linux NANO editor or publisher of Vi such change in NANO

Vi si dwarf are editors for Linux. Be it Ubuntu or RedHat, CentOSThese editors are vital when it comes to modify a script, an crontab or any other file present on the Linux operating system. I am kind and nano Notepad for LinuxWith the difference that they do not have a graphical interface. Open directly via command line and edit them using the terminal / console or through a login on Linux client support SSH, Like Putty or OS X Terminal.

For many users, Vi is a little more complicated, with a set of editing commands which rely on typing more effective than the controls shortcutplants, as the nano. The extemplu if we want to close a file opened with "you" have to type the command ": Quit!"Or shorter"Q!"While at" nano "is enough key combination" Ctrl + X ". From this point of view, it is more close to the nano Windows and interface OS X.

If you installed Linux operating system, which is set to "vi" text editor default, then you need to follow a few steps to change the text editor deault of "you" in "nano".

How to change default text editor "vi" in "nano" on CentOS

First make sure that you have the editor "nano" installed on your system. Login on terminal server and execute the command:

yum install nano

If you already installed the final message you will receive the latest version is already installed on your system

Ex. Package nano-2.0.9-7.el6.x86_64 already installed and latest version / Nothing to do

After being installed "nano" use this program to edit the file "/ Etc / bashrc

nano / etc / bashrc

In the file / etc / bashrc add the final line "export EDITOR =" nano ""

export EDITOR = "nano"

nano-editor-linux

Ctrl + X (y) and save changes. Log out of the system and log back on to test whether the default text editor changed.

This tutorial is particularly useful for editing commands that execute without specifying what editor will be used for the file. The best example is editing crontab swaps, which is done by the command: crontab -e. Executing this command will open the file in the editor cron job sites set on the system default.

In the scenario where vi editor It sets default system and do not want to change it, but you want to crontab file open nanoThen execute the following command in the terminal:

EDITOR = nano crontab -e env

Fiser crontab will automatically open and can be edited with nano for the current session.

Change default Linux via command line text editor software - Linux Tutorials & Tips.

How to set default on Linux NANO editor or publisher of Vi such change in NANO

About the author

Stealth

Passionate about everything that means gadgets and IT, I write with pleasure stealthsettings.com from 2006 and I like to discover with you new things about computers and operating systems macOS, Linux, Windows, iOS and Android.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment is processed.