Wildcard search with grep
I have a file that contains many IP addresses. I wanted to list all the ip addresses in the file and I used grep with a pattern 192.16* but it doesn't show the whole list of IP addresses. I am able to list the whole IP addresses only while using period followed with an asterisk symbol. So my doubt is Why 2nd option not working but 3rd option works fine.
root@test:~/test# cat z
192.168.1.0
192.168.2.0
192.168.110.7
192.168.115.5
1. root@test:~/test# grep -o 192.1 z
192.1
192.1
192.1
192.1
2. root@test:~/test# grep -o 192.1* z
192.1
192.1
192.1
192.1
3. root@test:~/test# grep -o 192.1. z
192.16
192.16
192.16
192.16
4. root@test:~/test# grep -o 192.1.* z
192.168.1.0
192.168.2.0
192.168.110.7
192.168.115.5