Microsoft
Software
Hardware
Network
Question : Bash sort / cut / uniq script to analyze domains
I have a list of domains that I'd like to trim down a little bit. I only want the domains listed and not the subdomains of each domain. For example, the list below:
ff.search.yahoo.com
files.opensuse.org
files.widgetbox.com
yahoo.com
forums.dpreview.com
forums.opensuse.org
images.dpreview.com
geo.yahoo.com
go.microsoft.com
updates.vista.microsoft.co
m
I want to reduce to:
yahoo.com.com
opensuse.org
widgetbox.com
dpreview.com
microsoft.com
It would just be the cat's pajamas if I cut use the Cut command, specify the '.' as field separator and return the RIGHT two fields instead of numbering from the left. But I don't think that's possible, at least from what I've read and searched so far.
To say it another way, II only want to deal with two fields (as separated by '.'), not 4, 6, or three. And field quantity is a variable, depending on how many subdomains need to be deleted. I can't use AWK, but SEDis available to my systeme, if Ihave to use something other than Cut or Sort.
Answer : Bash sort / cut / uniq script to analyze domains
sed 's/.*\.\(.*\.\)/\1/' | sort -u
Random Solutions
Word VBA how to find/delete pge breaks
Hard Drive Space from G: drive to D: drive?
Importing records from external table gives duplicate records.
cannot connect pocket pc via BlueTooth using activesync
Photoshop CS4 - Batch zoom into 1:1 pixel ratio? Perference? For large images... zoom ratio
DTC between windows server 2008 (WEB) & Windows Server 2000 (Standard)
manipulating coldfusion pie charts legend and shape
Dummy web loading screen - Image in front
Remote Ghosting
exchange 2007 mailbox server install fails with"Access to address list service on all Exchange 2007 servers has been denied