Skip to content

Instantly share code, notes, and snippets.

@sweetmandm
sweetmandm / Merge Files at Line Breaks
Created September 5, 2012 00:49
simple command to merge two files at line breaks using awk.
//Spaces between lines:
awk 'NR==FNR{a[FNR]=$0;next} {print a[FNR],$0}' file1 file2 > file3
//No spaces between lines:
awk 'NR==FNR{a[FNR]=$0;next} {print a[FNR]$0}' file1 file2 > file3
@sweetmandm
sweetmandm / One-Line Command to Add an SSH Key
Created August 30, 2012 19:40
One-Line Command to Add an SSH Key
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'