BSD Unix® Toolbox: 1000+ Commands for FreeBSD®, OpenBSD, and NetBSD®
by Francois Caen, Christopher Negus
Chapter 5. Manipulating Text
With only a shell available on the first UNIX systems (on which BSD systems were based), using those systems meant dealing primarily with commands and plain text files. Documents, program code, configuration files, e-mail, and almost anything you created or configured was represented by text files. To work with those files, developers created many text manipulation tools.
Despite having graphical tools for working with text, most seasoned BSD users find command line tools to be more efficient and convenient. Text editors such as vi (vim), Emacs, JOE, nano, and Pico are available with most BSD distributions. Commands such as grep, sed, and awk can be used to find, and possibly change, pieces of information within text files.
This chapter explains how to use many popular commands for working with text files in BSD systems. It also explores some of the less common uses of text manipulation commands that you might find interesting.
Matching Text with Regular Expressions
Many of the tools for working with text enable you to use Regular Expressions, sometimes referred to as regex, to identify the text you are ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access