From grep's manual
ps -ef | grep ’[c]ron’
If the pattern had been written without the square brackets, it would have matched not only the ps output line for cron, but also the ps output line for grep. Note that on some platforms, ps limits the output to the width of the screen; grep does not have any limit on the length of a line except the available memory
Doesn't [c]ron
mean the same as cron
, because [c]
means a singleton set of alternative characters?
Why does it not match the ps output line for grep?
Thanks.