I have a file with lots of host names. Some have a url part after the host that I\'d like to remove. In other words:
google.com facebook.com acme.com/news/frontp
One way:
sed 's|/.*||' file
Results:
google.com facebook.com acme.com bbc.co.uk abc.com
You may want to read more about using the slash as a delimiter. HTH.