Need help

Please help me to execute grep command to search for the pattern which begins with D or H.

grep command pattern for lines that begin with D or H:

$ grep '^[DH]' inf_files >out_file
1 Like
echo "DATA" | grep "^[DH]"
1 Like

Thanks :slight_smile:

---------- Post updated at 08:32 AM ---------- Previous update was at 08:31 AM ----------

Thanks

ruby -ne 'print if /^[DH]/' file
1 Like