mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
commit
8f21ac7dab
1 changed files with 23 additions and 0 deletions
23
pages/common/comm.md
Normal file
23
pages/common/comm.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
# comm
|
||||
|
||||
> Select or reject lines common to two files. Both files must be sorted.
|
||||
|
||||
- Produce three tab-separated columns: lines only in first file, lines only in second file and common lines.
|
||||
|
||||
`comm {{file1}} {{file2}}`
|
||||
|
||||
- Print only lines common to both files.
|
||||
|
||||
`comm -12 {{file1}} {{file2}}`
|
||||
|
||||
- Print only lines common to both files, read one file from stdin.
|
||||
|
||||
`cat {{file1}} | comm -12 - {{file2}}`
|
||||
|
||||
- Print lines only found in first file.
|
||||
|
||||
`comm -23 {{file1}} {{file2}}`
|
||||
|
||||
- Print lines only found in second file.
|
||||
|
||||
`comm -13 {{file1}} {{file2}}`
|
Loading…
Add table
Reference in a new issue