Difference between revisions of "Sed -i"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
-i tells sed to modify the file in place. | -i tells sed to modify the file in place. | ||
− | sudo sed -i '/#net.ipv4.ip_forward=1/s/^#//g' [[/etc/sysctl.conf]] | + | sudo sed -i '/#[[net.ipv4.ip_forward]]=1/s/^#//g' [[/etc/sysctl.conf]] |
[[.BAK]] | [[.BAK]] |
Revision as of 13:47, 13 February 2023
-i tells sed to modify the file in place.
sudo sed -i '/#net.ipv4.ip_forward=1/s/^#//g' /etc/sysctl.conf
.BAK gsed -i
See also
sed, gsed
,-n, -i
,Ansible: replace
,append
,Chef: Editing a file
,lineinfile
Advertising: