In short, the command to replace some file contents is below.  Read on for more info.
sed -i ‘s/ONBOOT=no/ONBOOT=yes/g’ /etc/sysconfig/network-scripts/ifcfg-enp0s3

The above command when issued as the root user will set the default CentOS 7 network adapter to automatically turn on when the system is booted up.  In the default network configuration in CentOS 7, that means DHCP is enabled and the network interface card will be assigned an IP address from the network.
Here’s a break down of the sed command.  The command ‘sed’ does not stand for Severe Emotional Disorder even though computers may appear to behave that way at times (especially the new Windows 10).  The command appears from my research to stand for “stream editor disk” because you can edit streams of data on or to the disk.
The ‘-i’ is to tell sed to edit the file “in place” which means you are going to edit the file not make a new one.  If you do not use the -i option, then you will find your file empty after running the command (another case for making a backup of files before you edit them).
The single quotes contain the command sed interprets.  The first letter in our example above is to tell sed to “switch” or “swap” the old information for the new info.  So, in our example, I wanted to swap “ONBOOT=no” with “ONBOOT=yes” in the file.  And the forward slash is to separate the elements of the command.
NOTE:  If you want to replace a forward slash in the file you can do that too.  You just need to put a back slash in from of it first.  That can get a little confusing.  Look closely, but the following command will replace the forward slash with back slashes.
sed -i ‘s/\//\\/g’ somefile
The text you want to replace is next.  In our example that is “ONBOOT=no” followed by another forward slash.  This is followed by the new text we want in the file, “ONBOOT=yes” with another forward slash.  The “g” is to tell sed to make the changes to every instance in the entire file or “globally”.  To finish up the command we close it with a single quote.
And the final element in our example command is the name of the file we want to change.  In our example that is the interface configuration file for our enp0s3 network interface.  That file is located in the following place:
/etc/sysconfig/network-scripts/ifcfg-enp0s3
Hope you enjoy this little introduction to the sed command in Linux.  It is really powerful, and has many more uses, but this it one of the most commonly used ones.  Thanks to LinuxTechie over at word press for his or her explanation.  You can find LinuxTechie’s blog post about sed below.
https://linuxtechie.wordpress.com/2008/02/06/using-sed-to-replace-words-in-a-file/

If you want more information on the powerful program sed, check out the folks over at The Linux Documentation Project.  They have a very detailed explanation of sed with great examples.  They have some examples for including sed in scripts as well.