How to Edit File in CentOS


CentOS is a free, open source, Enterprise class Linux distribution which was created using the RedHat Enterprise Linux source code. The majority of the CentOS operating system is exactly the same as the RedHat distribution. Linux configuration files are usually plain text files that can be edited in any text editor. The default command line text editor for CentOS is the Vi text editor. The default graphical text editor is gedit in the Gnome desktop environment and Kate in the KDE desktop environment. You can use any of these text editors to edit plain text files.

Command Line

  • Click on the "Terminal Quick Launch" button in the panel at the bottom of the screen.

  • Type the command "vi filename" to open the file in the Vi text editor. Replace "filename" with the name of the file that you want to edit.

  • Use the "j" (down), "k" (up), "h" (left) or "l" (right) keys to navigate through the document.

  • Press the "i" key to insert text before the cursor. Press the "a" key to insert text after the cursor. Press the "R" key to replace characters. Press the "x" key to delete characters.

  • Press the "ESC" key to return to the Command mode and continue to navigate through the document.

  • Type ":wq" to save and close the document.

Graphical Method

  • Double-click on the file that you want to edit. The file will open in either the Gedit (Gnome) or Kate (KDE) text editor, depending on the desktop environment you are using.

  • Use the mouse to navigate through the text file.

  • Use the keyboard to insert, delete and modify the text.

  • Click on the "Save" option under the "File" menu to save the file.

  • Click on the "X" in the upper right corner of the screen to close the file.

Related Searches


Promoted By Zergnet



You May Also Like

  • How to Edit PDF Files in Linux

    Linux offers very few choices when it comes to editing Portable Document Format files (PDFs) that you download from the Internet. Luckily,...

  • How to Configure Sendmail

    Sendmail is an email routing application for the Unix and Linux operating systems. It supports most mail delivery methods, including SMTP, HylaFax,...

  • How to Edit Using Unix Vi Editor

    The Unix vi editor command was created to make it more efficient and convenient to edit text in Unix. It allows you...

  • Change Prompt Name in Red Hat

    Shell prompt names define how the prompt in the terminal appears when the user opens their shell. On Red Hat (and most...

  • How to Change an Owner of a Folder in CentOS

    The Linux CentOS distro assigns an owner to every file and folder on the system. Normally, the person who creates the folder...

  • How to View a Text File With CentOS

    CentOS, or Community Enterprise Operating System, is a Linux distribution that uses the source code from Red Hat's commercial Enterprise Linux distribution....

  • How to Change Permissions on CentOS

    Bypassing the Linux CentOS's "permission denied" message when you want to edit a file is a simple process. CentOS (Community ENTerprise Operating...

  • How to Change CentOS to a Static IP

    CentOS is an Enterprise Linux distribution maintained by the open source community. It is created using the RedHat Enterprise Linux source code....

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!