sed -i '8i This is Line 8' FILE
inserts at line 8
This is Line 8
into file FILE
-i
does the modification directly to file FILE, no output to stdout, as mentioned in the comments by glenn jackman.
More Related Contents:
- Remove non-ASCII characters from CSV
- Remove multi-line comments
- Remove line if field is duplicate
- delete a column with awk or sed
- remove ^M characters from file using sed
- How to use awk to print lines where a field matches a specific string?
- What is the difference between sed and awk? [closed]
- How do you delete all lines that contain no letters from the alphabet using either grep, sed, or awk? [closed]
- Is it possible to replace a newline AND another character with a single tab using sed?
- How can I manipulate text in bash? [closed]
- substitute words on a line only before first delimeter using sed or awk
- How can I replace each newline (\n) with a space using sed?
- Using different delimiters in sed commands and range addresses
- How to merge every two lines into one from the command line?
- How to delete duplicate lines in a file without sorting it in Unix
- Why doesn’t `\d` work in regular expressions in sed? [duplicate]
- Extraction of data from a simple XML file
- Using different delimiters in sed commands and range addresses
- Remove all text before colon
- Print lines in one file matching patterns in another file
- How to remove trailing whitespaces with sed?
- Do a tail -F until matching a pattern
- Removing Windows newlines on Linux (sed vs. awk)
- Uppercasing First Letter of Words Using SED
- Add text at the end of each line
- sed: Replace part of a line
- Print lines in file from the match line until end of file
- Have sed ignore non-matching lines
- Awk replace a column with its hash value
- How to delete rows from a csv file based on a list values from another file?