Daily tip

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