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

eclipse plugin - Run java code error: Workspace is closed -

ios - How do I use CFArrayRef in Swift? -

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