Last month’s column explained why text files are so important to Linux users and described how to use filters to process text. This month’s column will dive a little deeper into text processing by explaining the basics of using the vi editor. If you think that knowing how to use pico or notepad is all you need to know about editors and editing, read on. You’ll soon discover that vi has capabilities as wide ranging as those of a Swiss army knife, providing functions you won’t find in most other editors.
Figure One: Switching from command mode to insert mode in vi.
Last month’s column explained why text files are so important to Linux users and described how to use filters to process text. This month’s column will dive a little deeper into text processing by explaining the basics of using the vi editor. If you think that knowing how to use pico or notepad is all you need to know about editors and editing, read on. You’ll soon discover that vi has capabilities as wide ranging as those of a Swiss army knife, providing functions you won’t find in most other editors.
Why vi?
Ask a group of Linux sysadmins to name their favorite tools and you’ll often find that the vi editor is at or near the top of the list. The vi editor is a compact and efficient tool that is found on the installation and rescue media of several Linux distributions. Consequently, it’s apt to be available even when bulkier editors, such as those based on X, are not. If you’re trying to repair a broken system, you’ll likely find knowledge of vi helpful.
However, wide-spread availability due to a small disk footprint is not vi’s only asset. On the contrary, vi lets you perform sophisticated pattern matching and replacement…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: