if I wanted to match ‘foo13245′, can I use grep ‘foo[\d]*’?

Nope, \d has no meaning (unless using -P for PCRE). You need [[:digit:]] instead; i.e.,

grep 'foo[[:digit:]]*'

Leave a Reply