How do I change a line in a file without opening it?
By using sed, the stream editor. For example like below
#sed -i.bak ‘/^search/s/esample.com/example.com’ /etc/resolv.conf
You also create a backup copy with the .bak suffix
How do I change a line in a file without opening it?
By using sed, the stream editor. For example like below
#sed -i.bak ‘/^search/s/esample.com/example.com’ /etc/resolv.conf
You also create a backup copy with the .bak suffix