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
Post a Comment