From 00ae06b5ad15db49873e54dc94aff578064888f9 Mon Sep 17 00:00:00 2001 From: tarrenj Date: Tue, 26 May 2015 17:38:53 -0700 Subject: [PATCH] Update README.md Adds something about creating multiple directories with one command. --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 7a9fadb..2ee98e3 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,26 @@ A few examples of piecing together commands: ``` find . -type f -ls ``` +- You can simplify the creation of a directory tree by using `{}`: +``` + mkdir -p ~/test/{one,two,three}/subtest.{one,two,three} +``` + creates: +``` +~/test/ +|_____one/ + |_____subtest.one + |_____subtest.two/ + |_____subtest.three/ +|_____two/ + |_____subtest.one + |_____subtest.two/ + |_____subtest.three/ +|_____three/ + |_____subtest.one + |_____subtest.two/ + |_____subtest.three/ +``` - Use `xargs` or `parallel` whenever you can. Note you can control how many items execute per line (`-L`) as well as parallelism (`-P`). If you're not sure if it'll do the right thing, use xargs echo first. Also, `-I{}` is handy. Examples: ```