Skip to content

Instantly share code, notes, and snippets.

@stollcri
Created November 25, 2015 21:02
Show Gist options
  • Select an option

  • Save stollcri/9987e685db9fa71a050e to your computer and use it in GitHub Desktop.

Select an option

Save stollcri/9987e685db9fa71a050e to your computer and use it in GitHub Desktop.
Insert text into a file at a specified line number
# insert ADDTHISTEXT at line 4 of MYFILE.TXT
sed -i '4i\ADDTHISTEXT\' MYFILE.TXT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment