Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
linux_wiki:sed [2016/03/18 23:23] billdozor [Sed] |
linux_wiki:sed [2016/03/28 22:06] billdozor [Print Lines] |
||
---|---|---|---|
Line 24: | 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) | ||
---- | ---- |