In this article, we will learn in vi / vim editor how can we remove all the spaces at the beginning or end of the file. Recently, we have encountered the problem where contents where copied from one file to another file with new file extension. There we found too many uneven spaces in each line at beginning and end.
vi
vi : Edit file without opening it
In this post I am sharing the trick to edit file without opening it. To achieve this task we will use vi editor. vi is very well known,popular,ultimate and awesome editor and by default available in all Unix/Linux operating system. Syntax: vi -c ‘COMMAND|wq’ /path/of/file Example: We will replace a keyword with new keyword in […]
set and unset line number in file with vi editor
In this tutorial we will learn, set and unset line number in file with vi editor. The same is applicable to vim editor also.(vim is advanced vi editor).vi editor is one of the famous and bydefault file editor in many linux distro. In vi editor you can use regex tricks. To set line number in […]



