File editors in linux

How to open, create, edit, and view a file in Linux

One thing GNU/Linux does as well as any other operating system is give you the tools you need to create and edit text files. Ask ten Linux users to name their favorite text editor, and you might get ten different answers. On this page, we cover a few of the many text editors available for Linux.

GUI text editors

This section discusses text editing applications for the Linux windowing system, X Windows, more commonly known as X11 or X.

If you are coming from Microsoft Windows, you are no doubt familiar with the classic Windows text editor, Notepad. Linux offers many similar programs, including NEdit, gedit, and geany. Each of these programs are free software, and they each provide roughly the same functionality. It’s up to you to decide which one feels best and has the best interface for you. All three of these programs support syntax highlighting, which helps with editing source code or documents written in a markup language such as HTML or CSS.

NEdit

NEdit, which is short for the Nirvana Editor, is a straightforward text editor that is very similar to Notepad. It uses a Motif-style interface.

The NEdit homepage is located at https://sourceforge.net/projects/nedit/. If you are on a Debian or Ubuntu system, you can install NEdit with the following command:

For more information, see our NEdit information page.

Geany

Geany is a text editor that is a lot like Notepad++ for Windows. It provides a tabbed interface for working with multiple open files at once and has nifty features like displaying line numbers in the margin. It uses the GTK+ interface toolkit.

The Geany homepage is located at http://www.geany.org/. On Debian and Ubuntu systems, you can install Geany by running the command:

Gedit

Gedit is the default text editor of the GNOME desktop environment. It’s a great, text editor that can be used on about any Linux system.

The Gedit homepage is located at https://wiki.gnome.org/Apps/Gedit. On Debian and Ubuntu systems, Gedit can be installed by running the following command:

Terminal-based text editors

If you are working from the Linux command line interface and you need a text editor, you have many options. Here are some of the most popular:

pico started out as the editor built into the text-based e-mail program pine, and it was eventually packaged as a stand-alone program for editing text files. («pico» is a scientific prefix for very small things.)

The modern version of pine is called alpine, but pico is still called pico. You can find more information about how to use it in our pico command documentation.

On Debian and Ubuntu Linux systems, you can install pico using the command:

nano is the GNU version of pico and is essentially the same program under a different name.

On Debian and Ubuntu Linux systems, nano can be installed with the command:

vim, which stands for «vi improved,» is a text editor used by millions of computing professionals all over the world. Its controls are a little confusing at first, but once you get the hang of them, vim makes executing complex editing tasks fast and easy. For more information, see our in-depth vim guide.

On Debian and Ubuntu Linux systems, vim can be installed using the command:

emacs

emacs is a complex, highly customizable text editor with a built-in interpreter for the Lisp programming language. It is used religiously by some computer programmers, especially those who write computer programs in Lisp dialects such as Scheme. For more information, see our emacs information page.

On Debian and Ubuntu Linux systems, emacs can be installed using the command:

Redirecting command output into a text file

When at the Linux command line, you sometimes want to create or make changes to a text file without actually running a text editor. Here are some commands you might find useful.

Читайте также:  Не работает контекстное меню файлов windows 10

Creating an empty file with the touch command

To create an empty file, it’s common to use the command touch. The touch command updates the atime and mtime attributes of a file as if the contents of the file had been changed — without actually changing anything. If you touch a file that doesn’t exist, the system creates the file without putting any data inside.

For instance, the command:

The above command creates a new, empty file called myfile.txt if that file does not already exist.

Redirecting text into a file

Sometimes you need to stick the output of a command into a file. To accomplish this quickly and easily, you can use the > symbol to redirect the output to a file.

For instance, the echo command is used to «echo» text as output. By default, this goes to the standard output — the screen. So the command:

The above command prints that text on your screen and return you to the command prompt. However, you can use > to redirect this output to a file. For instance:

The above command puts the text «Example text» into the file myfile.txt. If myfile.txt does not exist, it is created. If it already exists, its contents will be overwritten, destroying the previous contents and replacing them.

Be careful when redirecting output to a file using >. It will overwrite the previous contents of the file if it already exists. There is no undo for this operation, so make sure you want to completely replace the file’s contents before you run the command.

Here’s an example using another command:

The above command executes ls with the -l option, which gives a detailed list of files in the current directory. The > operator redirects the output to the file directory.txt, instead of printing it to the screen. If directory.txt does not exist, it is created first. If it already exists, its contents will be replaced.

Redirecting to the end of a file

The redirect operator >> is similar to >, but instead of overwriting the file contents, it appends the new data to the end of the file. For instance, the command:

Источник

23 Best Open Source Text Editors (GUI + CLI) in 2021

Text editors can be used for writing code, editing text files such as configuration files, creating user instruction files, and many more. In Linux, text editors are of two kinds that is the graphical user interface (GUI) and command-line text editors (console or terminal).

In this article, I am taking a look at some of the best 21 open-source commonly used text editors in Linux on both servers and desktops.

1. Vi/Vim Editor

Vim is a powerful command-line based text editor that has enhanced the functionalities of the old Unix Vi text editor. It is one the most popular and widely used text editors among System Administrators and programmers that is why many users often refer to it as a programmer’s editor. It enables syntax highlighting when writing code or editing configuration files.

You can install Vim editor in Linux systems using your default package manager as shown.

If you want to see our complete series on vi(m), please refer to the links below:

  • Learn and Use Vi/Vim as a Full-Text Editor in Linux
  • Learn ‘Vi/Vim’ Editor Tips and Tricks to Enhance Your Skills
  • 8 Interesting ‘Vi/Vim’ Editor Tips and Tricks

Vi/Vim Linux Editor

2. Gedit

Gedit is a general-purpose GUI based text editor and is installed by default text editor on Gnome desktop environment. It is simple to use, highly pluggable and a powerful editor with the following features:

  • Support for UTF-8
  • Use of configurable font size and colors
  • Highly customizable syntax highlighting
  • Undo and redo functionalities
  • Reverting of files
  • Remote editing of files
  • Search and replace text
  • Clipboard support functionalities and many more

Gedit Editor

You can install Gedit editor in Linux systems using your default package manager as shown.

3. Nano Editor

Nano is an easy to use text editor, especially for both new and advanced Linux users. It enhances usability by providing customizable key binding.

Nano has the following features:

  • Highly customizable key bindings
  • Syntax highlighting
  • Undo and redo options
  • Full line display on the standard output
  • Pager support to read from standard input

Nano Editor

You can install Nano editor in Linux systems using your default package manager as shown.

You can check our complete guide for editing files with Nano editor at:

4. GNU Emacs

Emacs is a highly extensible and customizable text editor that also offers an interpretation of the Lisp programming language at its core. Different extensions can be added to support text editing functionalities.

Emacs has the following features:

  • User documentation and tutorials
  • Syntax highlighting using colors even for plain text.
  • Unicode supports many natural languages.
  • Various extension including mail and news, debugger interface, calendar, and many more
Читайте также:  Как снять родительский контроль с компьютера windows 10 без пароля

Emacs Editor

You can install Emacs editor in Linux systems using your default package manager as shown.

5. Kate/Kwrite

Kate is a feature-rich and highly pluggable text editor that comes with KDesktop Environment (KDE). The Kate project aims at the development of two main products that are: KatePart and Kate.

KatePart is an advanced text editor component included in many KDE applications that may require users to edit text whereas Kate is a multiple document interface (MDI) text, editor.

The following are some of its general features:

  • Extensible through scripting
  • Encoding support such as Unicode mode
  • Text rendering in bi-directional mode
  • Line ending support with auto-detection functionalities

Also remote file editing and many other features including advanced editor features, applications features, programming features, text highlighting features, backup features, and search and replace features.

Kate Editor

You can install Kate editor in Linux systems using your default package manager as shown.

6. Sublime Text Editor

Sublime Text is a powerful cross-platform source code editor with a Python programming interface. It supports many programming languages and markup languages, and features can be added by users with plugins, mostly community-built and supported under free-software licenses.

Sublime Text Editor for Linux

You can install Sublime Text editor in Linux systems using your default package manager as shown.

7. Jed Editor

Jed is also another command-line editor with support for GUI like features such as dropdown menus. It is developed purposely for software development and one of its important features is the support of Unicode mode.

Jed Editor

You can install Jed editor in Linux systems using your default package manager as shown.

8. gVim Editor

It is a GUI version of the popular Vim editor and it has similar functionalities as the command line Vim.

Gvim Editor

You can install gVim editor in Linux systems using your default package manager as shown.

9. Geany Editor

Geany is a tiny and lightweight integrated development environment that offers basic IDE-like features with a focus on software development using the GTK+ toolkit.

It has some basic features as listed below:

  • Syntax highlighting
  • Pluggable interface
  • Supports many file types
  • Enables code folding and code navigation
  • Symbol name and construct auto-completion
  • Supports auto-closing of HTML and XML tags
  • Elementary project management functionality plus many more

Geany Editor

You can install Geany editor in Linux systems using your default package manager as shown.

10. Leaf Pad

Leaf Pad is a GTK+ based, lightweight GUI based text editor which is also popular among Linux users today. It is easy to use by new Linux users.

It has the following features:

  • Codeset option
  • Allows auto-detection of codeset
  • Options of undo and redo
  • Display file line numbers
  • Supports Drag and Drop options
  • Printing support

Leafpad Editor

You can install Leaf Pad editor in Linux systems using snap package manager as shown.

11. Bluefish

Bluefish is an easy-to-install and advanced text editor targeting Linux programmers and web developers. It offers a wide set of features as listed below:

  • Lightweight and fast
  • Integrates external Linux programs such as lint, weblint, make, and many others and filters, piping such as sed, sort, awk, and many more
  • Spelling check feature
  • Supports working on multiple projects
  • Remote file editing
  • Search and replace support
  • Undo and redo option
  • Auto-recovery of modified files

Bluefish Editor

You can install Bluefish editor in Linux systems using your default package manager as shown.

12. Atom

Atom is a free and open-source cross-platform code editor developed by GitHub. It was built to be completely customizable using web technologies such as HTML and JavaScript and it has support for Node.js-based plugins and native Git control.

Atom’s feature highlights include:

  • 100% open source
  • Modern, customizable layout
  • Themes
  • Embedded Git support
  • Real-time collaboration with Telesync
  • Smart auto-complete and IntelliSense
  • Built-in package manager

Atom Text Editor

You can install Atom editor in Linux systems using the following commands.

13. VSCode

VSCode is a robust free and open-source modern text editor built by Microsoft for Linux, Mac, and Windows computers.

It offers tons of powerful features including:

  • Full debugging capability with an interactive console, breakpoints, call stacks, etc.
  • Built-in Git support with Git commands
  • IntelliSense
  • 100% customizability
  • Support for tons of languages straight out of the box
  • Toggable layouts
  • Built-in terminal

Visual Studio Code

You can install VSCode for your Linux distribution by downloading the .deb or .rpm package from the VSCode download page.

14. Light Table

Light Table is a powerful, clutter-free cross-platform text editor built to be customizable enough to be used in any that its user chooses.

Читайте также:  Удаление outlook windows 10

Light Table’s features include:

  • Inline evaluation
  • Real-time watches
  • Free and open source
  • Plugin manager
  • Powerful editing

Light Table Code Editor

You can install Light Table on Ubuntu and its derivatives using the following PPA.

15. Medit Text Editor

medit is a lightweight open-source text editor for Mac, Linux, and Windows. It originally started as a simple built-in component of the GGAP editor and is now its own stand-alone text editor.

medit’s features include:

  • Customizable syntax highlighting
  • Support for plugins written in Python, C, or Lua
  • Support for regular expressions
  • Configurable keyboard accelerators

Media Text Editor

You can download and install medit from the mooedit.sourceforge.net page.

16. Neovim – Vim-based Text Editor

Neovim is a hyperextensible vim-based text editor with a focus on usability and function extensibility. It was forked from the popular Vim editor in order to aggressively refactor its functionality and usability with modern GUIs, asynchronous job control, etc.

Neovim’s feature highlights include:

  • Free and open-source license
  • Support for XDG base directories
  • Compatibility with most Vim plugins
  • An embedded, configurable terminal emulator

Neovim – Vim-based Text Editor

You can install Neovim editor in Linux systems using your default package manager as shown.

17. Notepad++

Notepad++ is a customizable text editor built with a focus on speed and minimal program size for Windows platforms. It is developed based on Scintilla text editor and can have its functionality extended with tons of plugins.

Its features include:

  • Tabbed editing
  • Code folding
  • Bookmark support
  • Document map
  • Perl Compatible Regular Expression

Notepad++ Source Code Editor

You can install Notepad++ editor in Linux systems using snap package manage as shown.

18. Kakoune Code Editor

Kakoune is a free and open-source Vim-based modal text editor with an editing model that implements Vi’s keystrokes as a text editing language.

It has several features among which are:

  • Auto-indentation
  • Case manipulation
  • Piping each selection to an external filter
  • Hooks
  • Syntax highlighting
  • Customization
  • Multiple selections

Kakoune Code Editor

You can install the Kakoune editor in Linux systems using your default package manager as shown.

19. Micro – Terminal-based Text Editor

Micro is a command line-based text editor built to be easy and intuitive enough for users to take advantage of the features in other terminal-based text editors without the steep learning curve.

Micro’s feature highlights include:

  • Mouse support
  • Multiple cursors
  • Terminal emulation
  • High customizability
  • Plugin system
  • Static library with no dependencies

Micro Terminal Text Editor

You can easily install micro in your Linux distribution by running the following installation script.

20. Brackets Text Editor

Brackets is a modern free and open-source code editor created by Adobe with a focus on web development. It is written in HTML, CSS, and JavaScript to offer web developers a rich code editing experience with the ability to extend its native features using several free extensions.

Brackets features include:

  • A beautiful User Interface
  • Preprocessor support for SCSS and LESS
  • Inline editors
  • Live preview
  • Multiple tabbed editing
  • PHP support
  • Supports Language Server Protocol
  • Support for plugin extensions

Brackets Text Editor

You can install Brackets editor in Linux systems using snap package manager as shown.

21. Lite Editor

Lite is a new text editor mostly developed in the Lua language, that aims to offer something practical, pleasing, tiny and fast, created as simply as possible; easy to alter and expand, or to use without doing either.

Lite Text Editor

22. Ash Editor

ash is a plain and clean command line-based text editor, that designed to be easy to use with modern key-bindings and it is efficient enough to manage a large number of files simultaneously and has a broad array of modern features.

Ash – Modern Terminal Text Editor

23. CudaText

CudaText is a new clean open-source and cross-platform text editor that comes with tons of features which include:

  • Syntax highlight for a lot of languages.
  • Find/Replace with regular expressions.
  • Command palette, with fuzzy matching.
  • Binary/Hex viewer for files of unlimited size.
  • Support for many encodings.

CudaText – cross-platform text editor

Concluding

I believe the list is more than what we have looked at, therefore if you have used other free and open-source text editors, let us know by posting a comment. Thanks for reading and always stay connected to Tecmint.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

Оцените статью