| Meaning |
{
"tool": "sed",
"full_name": "Stream Editor",
"type": "Unix text processing utility",
"description": "sed is a command-line utility for parsing and transforming text using a simple, compact programming language. It reads input line by line, applies editing commands, and writes the result to standard output or a file.",
"common_options": [
"-e <script>",
"-f <script-file>",
"-i[SUFFIX]",
"-n"
],
"common_commands": [
{
"command": "s/old/new/g",
"description": "Replace all occurrences of 'old' with 'new' on each line."
},
{
"command": "d",
"description": "Delete the current pattern space (i.e., remove the line)."
},
{
"command": "p",
"description": "Print the current pattern space (often used with -n)."
},
{
"command": "a\text",
"description": "Append 'text' after the current line."
},
{
"command": "i\text",
"description": "Insert 'text' before the current line."
}
],
"example_usage": "sed -i 's/\bcat\b/dog/g' animals.txt",
"notes": [
"sed scripts can be chained with semicolons or placed on separate -e options.",
"When using -i without a suffix, the original file is modified in place."
]
} |