linux - Grep two words followed by a alphabetic character -


How can I make both "HD" and "SD" after any alphabetical character in an order?

Example: * = Alphabetical characters

  dmesg | Grep hd * dmesg | Grep sd *  

using the -E option For grep :

  dmesg | Grep -E 'HD * | Sd * ' 

For your specific example, you do not even need to type the -E option:

  Dmesg | Grep '[HS] D *'  

will suffice.


Comments

Popular posts from this blog

scala - Play Framework - how to bind form to a session field -

Django Celery - running scheduled tasks -

perl - 'Unquoted string ".." may clash with future reserved word' but only when package is used -