Frage

I tried the following commands

cat filename.txt | grep "<Line: (429|6854)>"
cat filename.txt | grep "<Line: \(429\|6854\)>"

to show the lines containing <Line: 429> or <Line: 6854> but I'm not getting any output.

War es hilfreich?

Lösung

You have to use grep -E or egrep:

grep -E '<Line: (429|6854)>' filename.text
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top