OK, specifically, sed -e 's/http\:\/\/www\.domain\.htm\///g' *.htm > *.htm The sed command processes files with some regexp stuff, this command removes the http://www.domain.htm/ from htms. NOTE: not sure if u have to use a '\' before that ':'