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
awk -F/ '{print $1}' your_file
or
all the other solutions cannot change the file inplace.but in case of steve you need to add a -i flag for that sed solution.But still it will not work on solaris. below perl solutiopn works on all the platform and replaces the file inplace
perl -pi -e 's/\/.*//g' your_file