{Find IP addresses from logs
}
To search given pattern
|
| Asterik character is use to The backward slash is a escape character
| match anything or none. In which is use to know the shell that given
| this there may be two more character is not a part of regurlar
| number in each octet or expression or in other words avoid to use
| none. as regular expression. Dot is a one kind
| | _________of regular expression which use to match
| | | any but not empty.
| | |
# grep '[1-9]*\.[0-9]*\.[0-9]*\.[1-9]*' /var/log/syslog
| | | | | | | |
|___| |___| |___| |___|
| | | |
| | | |
Range are declared by putting dash - character in
between numbers from 1 to 9 for the first and the
fourth octet and 0 to 9 for the second and third
octet of IP address. In first and fourth octet
First number would be higher than zero and in the
second and third octet first number can be 0 or
higher than zero.
Last updated on 18 February 2025 7:00 am IST