Difference between revisions of "Sed -i"
Jump to navigation
Jump to search
(Redirected page to Sed) Tags: New redirect, Mobile web edit, Mobile edit |
|||
(10 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | # | + | {{lc}} |
+ | * https://manpages.ubuntu.com/manpages/noble/en/man1/sed.1.html | ||
+ | |||
+ | -i tells sed to modify the file in place. | ||
+ | |||
+ | -i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if SUFFIX supplied) | ||
+ | |||
+ | sudo [[sed]] -i '/#[[net.ipv4.ip_forward]]=1/s/^#//g' [[/etc/sysctl.conf]] | ||
+ | |||
+ | == Related == | ||
+ | [[.BAK]] | ||
+ | [[gsed -i]] | ||
+ | [[Add line]] | ||
+ | |||
+ | == See also == | ||
+ | * {{sed}} | ||
+ | |||
+ | [[Category:Linux]] |
Latest revision as of 12:42, 31 January 2024
-i tells sed to modify the file in place.
-i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if SUFFIX supplied)
sudo sed -i '/#net.ipv4.ip_forward=1/s/^#//g' /etc/sysctl.conf
Related[edit]
.BAK gsed -i Add line
See also[edit]
sed, gsed
,-n, -i
,Ansible: replace
,append
,Chef: Editing a file
,lineinfile
Advertising: