How do I search for more than one thing in a file?



  • You can search for more than one thing in a file using a command called egrep, as follows:

    This will search for the word cheese and the word onion in the file called /tmp/textfile

    $ egrep "cheese|onion" /tmp/textfile
    

Log in to reply
 

© Lightnetics 2024