[TriLUG] how to grep

Greg Cox glcox at pobox.com
Thu Feb 6 19:01:51 EST 2003


> I need to grep a certain number from a file, but only when it is a certain 
> location on each line, for example I want to find 12345678901, but only if 
> it is in position 46 through 56 on each line in the file, not if it is in 
> any other position.

cat file | egrep '^.{45}12345678901'




More information about the TriLUG mailing list