linux: how to replace text in file from command line

vi editor and search expressions

Linux has several different utilities that can perform string or text manipulation. Depending on your environment and the tools that are available, you should be able to easily parse, find and replace any string in a text file. Almost every single text editor comes with a find and replace feature with a UI, so we are going to only explore…

vi editor: how to go to a line by line number

vi editor and search expressions

The vi or vim editor is the popular and feature rich editor for editing text files in Linux. You can go to a particular line in the editor in several ways depending on where you are accessing it from. from the command line If you are opening a file from the command line, and you want the cursor at a…

how to delete lines in vi or vim editor in linux

vi editor and search expressions

If you use vi or vim editor to edit text files, then you should know different text manipulation commands that exist in the editor. One of the common actions you will perform is the deletion of a line or multiple lines from with in the editor. Let’s see the various ways you can delete a line in the vim editor….

how to enable and disable syntax highlighting in vi or vim editor

vi syntax on and off

Syntax Highlighting is a feature where the readability of the displayed text is enhanced by showing certain words, phrases or keywords in differing colors or fonts. This is especially useful when viewing source code of various programming, scripting or markup languages. In fact any text with an associated grammar can have syntax highlighting. Integrated Development Environments (IDE) or Programming Editors…

how to show line numbers in gedit text editor

gedit line numbers linux

There are many graphical editors in Linux, many with specific or unique features for text editing. GEdit and Kate are probably the most popular of these, mostly because they are tied to desktop environments such as Gnome and KDE respectively. There are several more that you could try such as Cream, JEdit, Kwrite and Scribes. GEdit has been quite popular…

10 most popular command line text editors and viewers in linux and unix

Nano editor in linux

The command line interface (CLI) is a very important feature in Linux and Unix environments that you should master to get the most out of these systems. Almost all functions/features that you can perform in a desktop environment can be done using a command line. This function can be highly beneficial when you are working remotely using ssh or something similar. One…