using sed to replace just one instance of a word/phrase on commandline

Using “sed” on command line to search/replace only one instance of a word/phrase in a file.

First, get a list of occurrences of the word/phrase using cat and grep:

cat file.ext | grep “exact word or phrase including html/code”

Choose one complete phrase or line to do the change:

sed -i ‘s~old phrase including <code>~new phrase including <html>~g’ file.ext

search-replace-using-sed

Cannot connect to internet on a fresh install of centos 6!

If you recently installed CentOS 6+ (Desktop) and if your Ethernet connections are showing up but not working, and getting this error”_nm_object_get_property: error getting ‘State’ for /org/freedesktop/NetworkManager/ActiveConnection/3: (19),”then follow the instructions below to correct the problem.First login to the machine directly as root or as a privileged user.1.  Disable NetworkManager by running ‘service NetworkManager stop.’2.  Enable network by running ‘service network start.’Now, check your internet connection by opening a well known website on the browser or try grabbing a random web page by running ‘wget domain.tld’ on command line or better yet, try updating your system by running ‘yum -y update.’Caution.  Before running ‘yum -y update,’ make sure you have enabled/disabled needed/unwanted repositories.  For more on repos, please visit, repos in CentOS.   

how to find your ipv6 address

Log in to your account/server as a privileged user or as root.

Type <ifconfig> which will display all your Ethernet/internet connections.

in the output, under the active internet connection, you will find your ipv6 address.