]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/sdiff/sdiff.1
bhnd(9): Fix a few mandoc related issues
[FreeBSD/FreeBSD.git] / usr.bin / sdiff / sdiff.1
1 .\" $FreeBSD$
2 .\" $OpenBSD: sdiff.1,v 1.15 2007/06/29 14:48:07 jmc Exp $
3 .\"
4 .\" Written by Raymond Lai <ray@cyth.net>.
5 .\" Public domain.
6 .\"
7 .Dd April 8, 2017
8 .Dt SDIFF 1
9 .Os
10 .Sh NAME
11 .Nm sdiff
12 .Nd side-by-side diff
13 .Sh SYNOPSIS
14 .Nm
15 .Op Fl abdilstHW
16 .Op Fl I Ar regexp
17 .Op Fl o Ar outfile
18 .Op Fl w Ar width
19 .Ar file1
20 .Ar file2
21 .Sh DESCRIPTION
22 .Nm
23 displays two files side by side,
24 with any differences between the two highlighted as follows:
25 new lines are marked with
26 .Sq \*(Gt ;
27 deleted lines are marked with
28 .Sq \*(Lt ;
29 and changed lines are marked with
30 .Sq \*(Ba .
31 .Pp
32 .Nm
33 can also be used to interactively merge two files,
34 prompting at each set of differences.
35 See the
36 .Fl o
37 option for an explanation.
38 .Pp
39 The options are:
40 .Bl -tag -width Ds
41 .It Fl l -left-column
42 Only print the left column for identical lines.
43 .It Fl o -output Ar outfile
44 Interactively merge
45 .Ar file1
46 and
47 .Ar file2
48 into
49 .Ar outfile .
50 In this mode, the user is prompted for each set of differences.
51 See
52 .Ev EDITOR
53 and
54 .Ev VISUAL ,
55 below,
56 for details of which editor, if any, is invoked.
57 .Pp
58 The commands are as follows:
59 .Bl -tag -width Ds
60 .It Cm l | 1
61 Choose left set of diffs.
62 .It Cm r | 2
63 Choose right set of diffs.
64 .It Cm s
65 Silent mode \(en identical lines are not printed.
66 .It Cm v
67 Verbose mode \(en identical lines are printed.
68 .It Cm e
69 Start editing an empty file, which will be merged into
70 .Ar outfile
71 upon exiting the editor.
72 .It Cm e Cm l
73 Start editing file with left set of diffs.
74 .It Cm e Cm r
75 Start editing file with right set of diffs.
76 .It Cm e Cm b
77 Start editing file with both sets of diffs.
78 .It Cm q
79 Quit
80 .Nm .
81 .El
82 .It Fl s -suppress-common-lines
83 Skip identical lines.
84 .It Fl w -width Ar width
85 Print a maximum of
86 .Ar width
87 characters on each line.
88 The default is 130 characters.
89 .El
90 .Pp
91 Options passed to
92 .Xr diff 1
93 are:
94 .Bl -tag -width Ds
95 .It Fl a -text
96 Treat
97 .Ar file1
98 and
99 .Ar file2
100 as text files.
101 .It Fl b -ignore-space-change
102 Ignore trailing blank spaces.
103 .It Fl d -minimal
104 Minimize diff size.
105 .It Fl I -ignore-matching-lines Ar regexp
106 Ignore line changes matching
107 .Ar regexp .
108 All lines in the change must match
109 .Ar regexp
110 for the change to be ignored.
111 .It Fl i -ignore-case
112 Do a case-insensitive comparison.
113 .It Fl t -expand-tabs
114 Expand tabs to spaces.
115 .It Fl W -ignore-all-space
116 Ignore all spaces.
117 .It Fl B -ignore-blank-lines
118 Ignore blank lines.
119 .It Fl E -ignore-tab-expansion
120 Treat tabs and eight spaces as the same.
121 .It Fl t -ignore-tabs
122 Ignore tabs.
123 .It Fl H -speed-large-files
124 Assume scattered small changes in a large file.
125 .It Fl -ignore-file-name-case
126 Ignore the case of file names.
127 .It Fl -no-ignore-file-name-case
128 Do not ignore file name case.
129 .It Fl -strip-trailing-cr
130 Skip identical lines.
131 .It Fl -tabsize Ar NUM
132 Change the size of tabs (default is 8.)
133 .El
134 .Sh ENVIRONMENT
135 .Bl -tag -width Ds
136 .It Ev EDITOR , VISUAL
137 Specifies an editor to use with the
138 .Fl o
139 option.
140 If both
141 .Ev EDITOR
142 and
143 .Ev VISUAL
144 are set,
145 .Ev VISUAL
146 takes precedence.
147 If neither
148 .Ev EDITOR
149 nor
150 .Ev VISUAL
151 are set,
152 the default is
153 .Xr vi 1 .
154 .It Ev TMPDIR
155 Specifies a directory for temporary files to be created.
156 The default is
157 .Pa /tmp .
158 .El
159 .Sh SEE ALSO
160 .Xr cmp 1 ,
161 .Xr diff 1 ,
162 .Xr diff3 1 ,
163 .Xr vi 1 ,
164 .Xr re_format 7
165 .Sh AUTHORS
166 .Nm
167 was written from scratch for the public domain by
168 .An Ray Lai Aq ray@cyth.net .
169 .Sh CAVEATS
170 Tabs are treated as anywhere from one to eight characters wide,
171 depending on the current column.
172 Terminals that treat tabs as eight characters wide will look best.