From afcd74c8bfdb025b6cd54681deb452a0b794b701 Mon Sep 17 00:00:00 2001 From: Kai KANG Date: Tue, 31 Mar 2015 17:52:08 +0800 Subject: [PATCH] Add cheatsheet for paste. --- cheat/cheatsheets/paste | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 cheat/cheatsheets/paste diff --git a/cheat/cheatsheets/paste b/cheat/cheatsheets/paste new file mode 100644 index 0000000..065f3f2 --- /dev/null +++ b/cheat/cheatsheets/paste @@ -0,0 +1,15 @@ +# Concat columns from files +paste file1 file2 ... + +# List the files in the current directory in three columns: +ls | paste - - - + +# Combine pairs of lines from a file into single lines: +paste -s -d '\t\n' myfile + +# Number the lines in a file, similar to nl(1): +sed = myfile | paste -s -d '\t\n' - - + +# Create a colon-separated list of directories named bin, +# suitable for use in the PATH environment variable: +find / -name bin -type d | paste -s -d : - \ No newline at end of file