Unix

Introduction

Unix is a widely used operating system.

Contents

Script Files

When multiple commands become necessary, a script file is much more practical. The format of the script file is one command per line:

$sed -f scriptfile inputfile

We use shell redirects to save the output to a file.

$sed -f scriptfile inputfile > outputfile

Another common option is -n. This option limits the output solely to lines intended to produce output, which are indicated by a /p at the end of the command.

$sed -n 's/pattern/substitute/p' inputfile

This command will print only the changes that are made.