| Comparing and Merging Files with GNU diff and patch by David MacKenzie, Paul Eggert, and Richard Stallman Paperback (6"x9"), 120 pages ISBN 0954161750 RRP £12.95 ($19.95) "Well packaged... the quality of information is excellent" --- Linux User and Developer Magazine (Issue 36, Feb 2004) Get a printed copy>>> |
2.3.4 Showing Alternate File Names
If you are comparing two files that have meaningless or uninformative
names, you might want diff to show alternate names in the header
of the context and unified output formats. To do this, use the
--label=label option. The first time
you give this option, its argument replaces the name and date of the
first file in the header; the second time, its argument replaces the
name and date of the second file. If you give this option more than
twice, diff reports an error. The --label option does not
affect the file names in the pr header when the -l or
--paginate option is used (see section 5.2 Paginating diff Output).
Here are the first two lines of the output from ‘diff -C 2 --label=original --label=modified lao tzu’:
*** original --- modified
| ISBN 0954161750 | Comparing and Merging Files with GNU diff and patch | See the print edition |