Clean Path in bsd and linux