Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:sed [2016/02/11 22:29] billdozor [Print Lines] |
linux_wiki:sed [2016/03/28 22:06] billdozor [Print Lines] |
||
---|---|---|---|
Line 6: | Line 6: | ||
**Checklist** | **Checklist** | ||
- | * Linux distro with the ' | + | * Distro(s): Any |
+ | * Package: | ||
---- | ---- | ||
Line 23: | Line 24: | ||
* q => quit/stop processing more input | * q => quit/stop processing more input | ||
* d => delete the pattern space (removes all but line 5 from output) | * d => delete the pattern space (removes all but line 5 from output) | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Swap Patterns ====== | ||
+ | |||
+ | Edit files by swapping pattern spaces. | ||
+ | |||
+ | * Before< | ||
+ | # Generated by NetworkManager | ||
+ | search local | ||
+ | nameserver 208.67.222.222 | ||
+ | nameserver 208.67.220.220</ | ||
+ | * After< | ||
+ | # Generated by NetworkManager | ||
+ | search local | ||
+ | nameserver 8.8.8.8 | ||
+ | nameserver 208.67.220.220</ | ||
+ | * -i => In-line editing | ||
+ | * s => swap | ||
+ | * g => global swap (swap every match, not just the first one) | ||
---- | ---- |