Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/comm/comm.1
Show All 25 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" From: @(#)comm.1 8.1 (Berkeley) 6/6/93 | .\" From: @(#)comm.1 8.1 (Berkeley) 6/6/93 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd December 12, 2009 | .Dd July 27, 2020 | ||||
.Dt COMM 1 | .Dt COMM 1 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm comm | .Nm comm | ||||
.Nd select or reject lines common to two files | .Nd select or reject lines common to two files | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Op Fl 123i | .Op Fl 123i | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
and | and | ||||
.Ev LC_CTYPE | .Ev LC_CTYPE | ||||
environment variables affect the execution of | environment variables affect the execution of | ||||
.Nm | .Nm | ||||
as described in | as described in | ||||
.Xr environ 7 . | .Xr environ 7 . | ||||
.Sh EXIT STATUS | .Sh EXIT STATUS | ||||
.Ex -std | .Ex -std | ||||
.Sh EXAMPLES | |||||
Assuming a file named | |||||
.Pa example.txt | |||||
with the following contents: | |||||
.Bd -literal -offset indent | |||||
a | |||||
b | |||||
c | |||||
d | |||||
.Ed | |||||
.Pp | |||||
Show lines only in | |||||
.Pa example.txt , | |||||
lines only in stdin and common lines: | |||||
.Bd -literal -offset indent | |||||
$ echo -e "B\enc" | comm example.txt - | |||||
B | |||||
a | |||||
b | |||||
c | |||||
d | |||||
.Ed | |||||
.Pp | |||||
Show only common lines doing case insensitive comparisons: | |||||
.Bd -literal -offset indent | |||||
$ echo -e "B\enc" | comm -1 -2 -i example.txt - | |||||
b | |||||
c | |||||
.Ed | |||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr cmp 1 , | .Xr cmp 1 , | ||||
.Xr diff 1 , | .Xr diff 1 , | ||||
.Xr sort 1 , | .Xr sort 1 , | ||||
.Xr uniq 1 | .Xr uniq 1 | ||||
.Sh STANDARDS | .Sh STANDARDS | ||||
The | The | ||||
.Nm | .Nm | ||||
utility conforms to | utility conforms to | ||||
.St -p1003.2-92 . | .St -p1003.2-92 . | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fl i | .Fl i | ||||
option is an extension to the | option is an extension to the POSIX standard. | ||||
.Tn POSIX | |||||
standard. | |||||
.Sh HISTORY | .Sh HISTORY | ||||
A | A | ||||
.Nm | .Nm | ||||
command appeared in | command appeared in | ||||
.At v4 . | .At v4 . |