Вопрос

How to group two regular expression in one command

example if have a file like:

age22
Helwan University Engineering Faculty
ITI-intake33
bye FOr NOW
i am mahmoud 34
mie 4
a

And I want to search for the line that start with by and end with W ???

Using grep command

Это было полезно?

Решение

You don't need more than one regular expression for this.

grep '^by.*W$' filename.txt

should suffice.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top