remove all text but IP addresses
I have a big log file with 20k lines with lots of info on it, but I want to only keep the IP addresses (and, if possible, deduplicated). For example, each line may read something like:
192.168.1.1 - lots of text that I do not want to keep [ZEFrgfosiglwkdnqbsg] GET /dnqfnqs
Then, after I'm left with only the IP, I would like to sort/deduplicate the lines.
The IPs are always at the beginning of each line.
Is there a command I could use for that?