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

ios - How do I use CFArrayRef in Swift? -

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

c - Error on building source code in VC 6 -