File size: 9,319 Bytes
21e19b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Source attribution

- [sed whole word search and replace](https://stackoverflow.com/questions/1032023/sed-whole-word-search-and-replace) — question: ksuralta; accepted answer: Joakim Lundborg (answer 1032039).

- [How to replace an entire line in a text file by line number](https://stackoverflow.com/questions/11145270/how-to-replace-an-entire-line-in-a-text-file-by-line-number) — question: user788171; accepted answer: chepner (answer 11145362).

- [Replace whole line containing a string using Sed](https://stackoverflow.com/questions/11245144/replace-whole-line-containing-a-string-using-sed) — question: Rahul; accepted answer: Todd A. Jacobs (answer 11245501).

- [How can I strip first X characters from string using sed?](https://stackoverflow.com/questions/11469989/how-can-i-strip-first-x-characters-from-string-using-sed) — question: Kokesh; accepted answer: Arnaud F. (answer 11470076).

- [How to extract text from a string using sed?](https://stackoverflow.com/questions/11568859/how-to-extract-text-from-a-string-using-sed) — question: RanRag; accepted answer: tripleee (answer 11568930).

- [sed with literal string--not input file](https://stackoverflow.com/questions/13055889/sed-with-literal-string-not-input-file) — question: amphibient; accepted answer: Gilles Quénot (answer 13055913).

- [How to use sed/grep to extract text between two words?](https://stackoverflow.com/questions/13242469/how-to-use-sed-grep-to-extract-text-between-two-words) — question: user1190650; accepted answer: Brian Campbell (answer 13242517).

- [Command to get nth line of STDOUT](https://stackoverflow.com/questions/1429556/command-to-get-nth-line-of-stdout) — question: Alana Storm; accepted answer: Jonathan Leffler (answer 1429628).

- [Why doesn't `\d` work in regular expressions in sed?](https://stackoverflow.com/questions/14671293/why-doesnt-d-work-in-regular-expressions-in-sed) — question: user2036880; accepted answer: Kamil (answer 14671415).

- [How to use sed to replace only the first occurrence in a file?](https://stackoverflow.com/questions/148451/how-to-use-sed-to-replace-only-the-first-occurrence-in-a-file) — question: David Dibben; accepted answer: Ben Hoffstein (answer 148473).

- [Insert line after match using sed](https://stackoverflow.com/questions/15559359/insert-line-after-match-using-sed) — question: user2150250; accepted answer: Gilles Quénot (answer 15559399).

- [Why does sed not replace all occurrences?](https://stackoverflow.com/questions/15849119/why-does-sed-not-replace-all-occurrences) — question: Nishant George Agrwal; accepted answer: Bruno Reis (answer 15849152).

- [Delete empty lines using sed](https://stackoverflow.com/questions/16414410/delete-empty-lines-using-sed) — question: jonas; accepted answer: Kent (answer 16414489).

- [Have sed ignore non-matching lines](https://stackoverflow.com/questions/1665549/have-sed-ignore-non-matching-lines) — question: Paggas; accepted answer: liori (answer 1665662).

- [The easiest way to replace white spaces with (underscores) _ in bash](https://stackoverflow.com/questions/1706431/the-easiest-way-to-replace-white-spaces-with-underscores-in-bash) — question: flazzarini; accepted answer: ghostdog74 (answer 1706459).

- [sed: print only matching group](https://stackoverflow.com/questions/17511639/sed-print-only-matching-group) — question: mort; accepted answer: iruvar (answer 17511700).

- [sed insert line with leading spaces to a specific line](https://stackoverflow.com/questions/18439528/sed-insert-line-with-leading-spaces-to-a-specific-line) — question: Ggdw; accepted answer: Atropo (answer 18439749).

- [bash, extract string before a colon](https://stackoverflow.com/questions/20348097/bash-extract-string-before-a-colon) — question: user788171; accepted answer: ray (answer 20348145).

- [Delete specific line number(s) from a text file using sed?](https://stackoverflow.com/questions/2112469/delete-specific-line-numbers-from-a-text-file-using-sed) — question: Justin Ethier; accepted answer: Brian Campbell (answer 2112496).

- [How to escape single quote in sed?](https://stackoverflow.com/questions/24509214/how-to-escape-single-quote-in-sed) — question: Thomas Bratt; accepted answer: Kent (answer 24509931).

- [Why is sed not recognizing \t as a tab?](https://stackoverflow.com/questions/2610115/why-is-sed-not-recognizing-t-as-a-tab) — question: sixtyfootersdude; accepted answer: Mark Byers (answer 2610121).

- [How to swap text based on patterns at once with sed?](https://stackoverflow.com/questions/26568952/how-to-swap-text-based-on-patterns-at-once-with-sed) — question: DaniloNC; accepted answer: ooga (answer 26568996).

- [How can I output only captured groups with sed?](https://stackoverflow.com/questions/2777579/how-can-i-output-only-captured-groups-with-sed) — question: Pablo; accepted answer: Dennis Williamson (answer 2778096).

- [In Bash, how do I add a string after each line in a file?](https://stackoverflow.com/questions/2869669/in-bash-how-do-i-add-a-string-after-each-line-in-a-file) — question: Jason Volkoz; accepted answer: Tom DeGisi (answer 2869736).

- [How do I remove newlines from a text file?](https://stackoverflow.com/questions/3134791/how-do-i-remove-newlines-from-a-text-file) — question: Alucard; accepted answer: Tyler McHenry (answer 3134827).

- [Replace newlines with literal \n](https://stackoverflow.com/questions/38672680/replace-newlines-with-literal-n) — question: Parze; accepted answer: anubhava (answer 38672741).

- [How to print lines between two patterns, inclusive or exclusive (in sed, AWK or Perl)?](https://stackoverflow.com/questions/38972736/how-to-print-lines-between-two-patterns-inclusive-or-exclusive-in-sed-awk-or) — question: fedorqui; accepted answer: fedorqui (answer 38972737).

- [sed one-liner to convert all uppercase to lowercase?](https://stackoverflow.com/questions/4569825/sed-one-liner-to-convert-all-uppercase-to-lowercase) — question: magnetar; accepted answer: magnetar (answer 4581564).

- [How to extract string following a pattern with grep, regex or perl](https://stackoverflow.com/questions/5080988/how-to-extract-string-following-a-pattern-with-grep-regex-or-perl) — question: wrangler; accepted answer: sidyll (answer 5081519).

- [How do I delete all lines in a file starting from after a matching line?](https://stackoverflow.com/questions/5227295/how-do-i-delete-all-lines-in-a-file-starting-from-after-a-matching-line) — question: DocWiki; accepted answer: Dennis Williamson (answer 5227429).

- [Using sed, how do you print the first 'N' characters of a line?](https://stackoverflow.com/questions/538664/using-sed-how-do-you-print-the-first-n-characters-of-a-line) — question: Berlin Brown; accepted answer: Paul Tomblin (answer 538676).

- [How can I delete all lines that contain a specific string from a text file?](https://stackoverflow.com/questions/5410757/how-can-i-delete-all-lines-that-contain-a-specific-string-from-a-text-file) — question: A Clockwork Orange; accepted answer: SiegeX (answer 5410784).

- [Bash tool to get nth line from a file](https://stackoverflow.com/questions/6022384/bash-tool-to-get-nth-line-from-a-file) — question: Vlad Vivdovitch; accepted answer: anubhava (answer 6022431).

- [Using sed to delete all lines between two matching patterns](https://stackoverflow.com/questions/6287755/using-sed-to-delete-all-lines-between-two-matching-patterns) — question: Ken; accepted answer: anubhava (answer 6287940).

- [How to insert a newline in front of a pattern?](https://stackoverflow.com/questions/723157/how-to-insert-a-newline-in-front-of-a-pattern) — question: Dennis; accepted answer: Dennis (answer 723247).

- [How to show only next line after the matched one?](https://stackoverflow.com/questions/7451423/how-to-show-only-next-line-after-the-matched-one) — question: facha; accepted answer: Michał Šrajer (answer 7451456).

- [How do I escape slashes and double and single quotes in sed?](https://stackoverflow.com/questions/7517632/how-do-i-escape-slashes-and-double-and-single-quotes-in-sed) — question: KRB; accepted answer: Kusalananda (answer 7517900).

- [Delete all lines beginning with a # from a file](https://stackoverflow.com/questions/8206280/delete-all-lines-beginning-with-a-from-a-file) — question: Village; accepted answer: Raymond Hettinger (answer 8206295).

- [How to replace a whole line with sed?](https://stackoverflow.com/questions/8822097/how-to-replace-a-whole-line-with-sed) — question: Michael; accepted answer: John Doyle (answer 8822211).

- [How to insert a text at the beginning of a file?](https://stackoverflow.com/questions/9533679/how-to-insert-a-text-at-the-beginning-of-a-file) — question: user219882; accepted answer: kev (answer 9533736).

- [How to merge every two lines into one from the command line?](https://stackoverflow.com/questions/9605232/how-to-merge-every-two-lines-into-one-from-the-command-line) — question: shantanuo; accepted answer: Kent (answer 9605559).

- [How to remove all white spaces from a given text file?](https://stackoverflow.com/questions/9953448/how-to-remove-all-white-spaces-from-a-given-text-file) — question: Lunar Mushrooms; accepted answer: Paulo Scardine (answer 9953487).