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 12:40, 31 January 2024
-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 Add line
See also
sed, gsed
,-n, -i
,Ansible: replace
,append
,Chef: Editing a file
,lineinfile
Advertising: