Parse fully qualified domain names from file

February 17, 2020

I ran in to a situation where i needed to parse all fully qualified domain names (FQDN) from bunch of files in the same directory.

Here is how to do that:

grep -R -h -Eo '(http|https)://[^/"]+' . | awk -F'/' '{ print $3 }' | sort | uniq

To remove the path from a list of domains + path:

sed 's/.*\///'