Skip to main content
added 13 characters in body
Source Link
slm
  • 380.1k
  • 127
  • 793
  • 897
  • grep -f a.txt <(cut -d '.' -f 1 up.txt) > common.txt
  • grep -vf <(cut -d '.' -f 1 dw.txt) common.txt
$ grep -f a.txt <(cut -d '.' -f 1 up.txt) > common.txt
$ grep -vf <(cut -d '.' -f 1 dw.txt) common.txt

comparesCompares first word between 2 files and writes to matching word to commoncommon.txt.txt Compares dw.txtdw.txt with common.txtcommon.txt and print inverted match ie. 'c'.

  • grep -f a.txt <(cut -d '.' -f 1 up.txt) > common.txt
  • grep -vf <(cut -d '.' -f 1 dw.txt) common.txt

compares first word between 2 files and writes to matching word to common.txt Compares dw.txt with common.txt and print inverted match ie. 'c'

$ grep -f a.txt <(cut -d '.' -f 1 up.txt) > common.txt
$ grep -vf <(cut -d '.' -f 1 dw.txt) common.txt

Compares first word between 2 files and writes to matching word to common.txt. Compares dw.txt with common.txt and print inverted match ie. 'c'.

Source Link
Nisha
  • 37
  • 4

  • grep -f a.txt <(cut -d '.' -f 1 up.txt) > common.txt
  • grep -vf <(cut -d '.' -f 1 dw.txt) common.txt

compares first word between 2 files and writes to matching word to common.txt Compares dw.txt with common.txt and print inverted match ie. 'c'