sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list
Here the "s" specifies the substitution. The "/" are delimiters. "jessie" is the search pattern and "stretch" is the replacement pattern. for more refer to sed manual page here or prefer manual page in your machine for sed commands.