-->
Previous Table of Contents Next


diff3......List Differences in Files

diff3 option(s) file1 file2 file3

PURPOSE

The diff3 command compares three files and returns the differences between them, as with diff, but does not automatically return the differences. Instead, one of the following codes is returned:

==== All three files differ.
====1 file1 is different.
====2 file2 is different.
====3 file3 is different.

OPTIONS

-a Treats all files as text; useful for determining if there are differences between binary files.
-A Creates an ed script that shows all differences between the files in brackets.
-e Creates an ed script that places differences between file2 and file3 into file1.
-E Creates an ed script that incorporates unmerged changes, delineated by brackets.
-i Adds the w (save) and q (quit) commands to the end of ed scripts.
-L name Uses name instead of the filename in the output.
-m Creates a new file with the changes merged; this is done directly and not with an ed script.
-T Inserts a tab at the beginning of each line of differences, instead of the default two spaces.
-x Creates an ed script that places all differences in the files in file1.
-X Creates an ed script that places all differences in the files in file1. This is same as -x, except that the differences are surrounded by brackets.
-3 Creates an ed script that places differences between file1 and file3 into file1.

RELATED COMMANDS

cmp
diff
sdiff

egrep......Search Files

egrep option(s) pattern file(s)

PURPOSE

The egrep command searches files for text (referred to as patterns or expressions) in multiple files or a single file. It is a cousin to the fgrep and grep commands and usually is considered the most powerful and fastest of the three. However, it doesn’t support all ASCII characters—it will search for +, |, (, ), and ? as long as they are surrounded by quotation marks, but it will not search for patterns beginning with \.

OPTIONS

-A num Displays num of lines after the matched pattern.
-B num Displays num of lines before the matched pattern.
-b Returns the block number of the matched line.
-c Returns the number of matches without listing the actual matches.
-C Displays two lines before and after the matched pattern.
-e pattern Searches for pattern when pattern begins with a hyphen (-).
-f file Uses a pattern from file.
-h Lists lines with matches without listing the files that contain them.
-i Ignores case when matching.
-l Lists files with matches without listing the actual matches.
-L Lists files that don’t contain matching lines.
-n Lists matched lines and their line numbers.
-s Suppresses error messages about files that can’t be read or accessed.
-v Lists lines that do not match the pattern.x
-w Lists only whole words that are matched.
-x Lists only whole lines that are matched.

EXAMPLES


$ egrep “Cogswell Cogs|Spacely Sprockets” *

This searches the current directory—as noted with *—for the strings Cogswell Cogs and Spacely Sprockets.

RELATED COMMANDS

grep
fgrep

elvis......Text Editor

elvis option(s) filename

PURPOSE

The elvis command launches a text editor. It’s a clone of the popular vi text editor; on Linux systems, if you use vi on a command line, you’ll really be invoking the elvis text editor. It responds to all the standard vi commands.

OPTIONS

-r Invokes the elvrec command to recover files.
-R Opens a file in read-only status.
-s Works in safe mode, so neophytes can’t do too much damage to files or a system.
-t tag Opens the file with tag as the first line.
-m file Searches through file for an error message from a compiler.
-e Starts in colon command mode, similar to the UNIX ex command.
-v Starts in visual command mode, similar to the UNIX vi command.

RELATED COMMANDS

elvrec
emacs
vi


Previous Table of Contents Next