Uncommenting %wheel NOPASSWD in /etc/sudoers sudo sed -i -e 's/^#\s*\(%wheel\s\+ALL=(ALL)\s\+NOPASSWD:\s\+ALL\)/\1/' / etc / sudoers Remove a line from a file solution: sed -i -e '/IPADDR/d' /etc/sysconfig/network-scripts/ifcfg-eth6 issue: I was moving an interface from a Physical NIC (eth6) to a Bridge (brbkup) therefore, I obviously no longer wanted an eth6 IPADDR entry. Insert text into a file at a specific line solution : sed -i -e '26i\ ' /etc/named.conf sed -i -e '27i\ \ \ \ \ \ \ \ managed-keys-directory\ \"\/var\/named\/dynamic\";' /etc/named.conf issue : I needed to add a directive into my /etc/named.conf file. It could not simply be appended and YES, my proposed solution makes quite a few assumptions... most importantly that the location I want my new line is indeed line 26. Before: /* Path to ISC DLV key */ bindkeys-file "/etc/named.iscdlv.key"; }; After...
Linux: The whole world made it for you... This blog is a collection of things I come across either at home or at work as a Linux Administrator. I have worked as an Admin working with Solaris, SAN, Backups and Linux at the Enterprise level for over 16 years.