Filtering

Many filter style programs provide the capability to manipulate the contents of files (for example, the commands, grep, tail, head, wc, sed, awk, xargs, and so on). Several of these are so powerful that they are the subject of separate books. Generally, a filter can accept input from stdin and pushes output to stdout. Become proficient with filter commands, and the need for using scripts to open individual files is diminished. Your creations will become more succinct and powerful. Many of these commands could easily take up a chapter on their own, but in this book, I'll introduce them and entice you to check them out on your own.

head

If you need to display the beginning lines of a file, use the head command. The head command outputs ...

Get Korn Shell Programming by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.