Skip to content

Instantly share code, notes, and snippets.

@denitram
Last active August 29, 2015 14:24
Show Gist options
  • Save denitram/4d210542b47b20608917 to your computer and use it in GitHub Desktop.
Save denitram/4d210542b47b20608917 to your computer and use it in GitHub Desktop.
sed
# Add the first line of file1 at the top of file2
$ h=head -n 1 file2
$ sed -i "1s/^/$h \n/" file2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment