Linux Command Cheat Sheet/Edit file in place with sed

Modify a file directly.

Section: sed awk and Structured Text Workflows

Edit file in place with sed

bash
bash
sed -i.bak 's/debug=false/debug=true/' app.conf
Explanation

Create a backup suffix when editing important files.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing sed awk and Structured Text Workflows
Print file contents
Concatenate and print files to standard output.
OpenIn sheetbash1 tag match
Search text with grep
Print lines matching a pattern.
OpenIn sheetbash1 tag match
Show first lines
Display the first lines of a file.
OpenIn sheetbash1 tag match
Show last lines
Display the end of a file.
OpenIn sheetbash1 tag match
Count lines words and bytes
Count content in files or streams.
OpenIn sheetbash1 tag match
Number lines
Display file contents with line numbers.
OpenIn sheetbash1 tag match