
344
|
Chapter 3: Linux Commands
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Examples
Create a three-column file from files x, y, and z:
paste x y z > file
List users in two columns:
who | paste - -
Merge each pair of lines into one line:
paste -s -d"\t\n" list
patch
patch [options] [original [patchfile]]
Apply the patches specified in patchfile to original. Replace the
original with the new, patched version; move the original to orig-
inal.orig or original~. The patch file is a difference listing produced
by the diff command.
Options
-b, --backup
Back up the original file.
--backup-if-mismatch, --no-backup-if-mismatch
When not backing up all original files, these options control
whether a backup should be made when a patch does not
match the original file. The default is to make backups unless
--posix is specified.
-c, --context
Interpret patchfile as a context diff.
-d dir, --directory=dir
cd to directory before beginning patch operations.
--dry-run
Print results of applying a patch, but don’t change any files.
-e, --ed
Treat the contents of patchfile as ed commands.
-f, --force
Force all changes, even those that look incorrect. Skip patches
if the original file does not exist; force patches for files with
the wrong version specified; assume patches are never
reversed.
-g num, --get num
Specify whether to check the original file out of source control ...