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
Try doing this :
cut -d '/' -f1 file.txt
or
awk -F/ '{print $1}' file.txt
perl -F/ -lane 'print $F[0]' file.txt