[[+content_image]]
O
O
Oleg2020-06-02 13:01:10
SSH
Oleg, 2020-06-02 13:01:10

Grep by email with an exception from the result, a specific domain (for example mail.ru)?

Good day to all!
The essence of the problem is to select all lines with email addresses from the maillog, but excluding mailboxes from the *@mail.ru domain from the result

grep  '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' ./maillog | grep -v '*@mail\.ru'

Doesn't work, please tell me where is the error?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
AUser0, 2020-06-02
@molekulo

Actually, you should use grep -E.
I also recommend adding an argument -o.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question