Quantcast
Channel: Grep for a line containing only 5 or 6 numbers - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 8

Grep for a line containing only 5 or 6 numbers

$
0
0

How would you grep for a line containing only 5 or 6 numbers? Something like this.

case 1 (has leading space)

           10      2       12      1       13

case 2 (no leading space)

   1       2       3       4       5        6

I thought something like this would work.

grep -E '[0-9]{5}'

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>