0

Is there any other way to find a text in a way without grep command from multiple files.

This was asked in one of my interview but I could find a possible solution for this question.

5

Numerous unix commands incorporate the functionality of grep, allowing a grep-like command to be implemented. Some obvious examples:

awk:

awk '/pattern/'

sed:

sed -n -e '/pattern/p'

perl:

perl -n -e 'print if (/pattern/)'
  • 2
    Ooh, ex with g/re/p! – muru Jul 30 '19 at 1:09
  • Thank you for response. I think I should try more complex scenarios. – Tanu Jul 31 '19 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.