You'd do it about the same way.
If you want the whole line to be just five digits, no more, no less, and nothing else, then:
Code:
awk '/^[0-9]{5}$/' /usr/share/wordlists/rockyou.txt
If you want the same but limited only to the first column, then:
Code:
awk '$1 ~ /^[0-9]{5}$/' /usr/share/wordlists/rockyou.txt
See "man 7 regex". Of course you might also use [[:digit:]] instead of [0-9] but that depends on your locale a little.