O'Reilly logo

LPIC-1/CompTIA Linux+™ Certification All-in-One Exam Guide by Robb Tracy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Processing Text Streams

When processing text streams within a script or when piping output at the shell prompt, there may be times when you need to filter the output of one command so that only certain portions of the text stream are actually passed along to the stndin of the next command. There are a variety of tools you can use to do this. In the last part of this chapter, we’ll look at using the following commands:

• cut

• expand and unexpand

• fmt

• join and paste

• nl

• od

• pr

• sed and awk

• sort

• split

• tr

• uniq

• wc

Let’s begin by looking at the cut command.

cut

The cut command is used to print columns or fields that you specify from a file to the standard output. By default, the Tab character is used as a delimiter. The following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required