Counting the number of lines containing real numbers

Hi there,I need a grep command that would search a file and return lines that ONLY contain numbers. Here's one way: grep ^[0-9]+[.]?[0-9]*[ ] filename. It looks for real numbers.
I, however, do not get the desired results. Upon hitting enter, the command prompt returns like there are no lines in the file that contain numbers. What am I doing wrong
Last edited on
grep ^[0-9] filename
?

Should this not be on http://www.linuxforums.org/ ?
Last edited on
Topic archived. No new replies allowed.