Using vi to Edit Text Files on A Linux Dedicated Server

A fact of life with Linux administration is that you will have to edit text files, simply because the operating system is configured using text files. Although modern versions of Linux (try Knoppix) do provide friendly graphical desktops and GUI (graphical user interface) aids for most configuration tasks, a dedicated web server will not have these facilities available, so you simply have to get into the text. The two most common programs used for editing text files from a command line interface are vi and emacs. We’ll look at vi in this article, as it is available on just about all default Linux installations. However, the fact is that vi is not an intuitive program to use, and will be completely alien to those used to editing files from Windows applications like Notepad. You will have to learn a completely new way of working, because there is no point and click operation at all, everything is achieved by entering keyboard commands. Here we’ll cover the basic steps involved in editing text files with vi, so that you will have a reference to work from when it comes to editing the important administration files on your server. Don’t think that this is going to be a complex, exhaustive coverage of the operation of vi. Keeping it simple, we’re just covering the barebones essentials that will enable you to do what needs to be done. Creating a file with vi The steps to create a file with vi are actually very simple. Enter the following at the command line. $ vi newfile.txt (Please refer back to the conventions used here.) You’ll...

Pin It on Pinterest