← 返回命令列表

Linux command

combine 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Output lines that appear in both files

combine [file1] and [file2]

Output lines in file1 but not in file2

combine [file1] not [file2]

Output lines that are in either file

combine [file1] or [file2]

Output lines present in exactly one file

combine [file1] xor [file2]

Read one input from standard input

cat [file1] | combine - and [file2]

说明

combine performs boolean set operations on the lines of two files, treating each file as a set of lines. Input does not need to be sorted; output lines appear in the order they occur in _file1_ (with _file2_ lines appended for or). The command is part of the moreutils collection of handy Unix utilities and is useful for quickly computing set relationships on plain text data without piping through sort, uniq, and comm.

参数

and
Output lines in _file1_ that are also in _file2_ (intersection).
not
Output lines in _file1_ that are not in _file2_ (set difference).
or
Output lines in _file1_ or in _file2_ (union); _file2_ lines are appended.
xor
Output lines in exactly one of _file1_ or _file2_ (symmetric difference).

FAQ

What is the combine command used for?

combine performs boolean set operations on the lines of two files, treating each file as a set of lines. Input does not need to be sorted; output lines appear in the order they occur in _file1_ (with _file2_ lines appended for or). The command is part of the moreutils collection of handy Unix utilities and is useful for quickly computing set relationships on plain text data without piping through sort, uniq, and comm.

How do I run a basic combine example?

Run `combine [file1] and [file2]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does and do in combine?

Output lines in _file1_ that are also in _file2_ (intersection).