20
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ディレクトリを複数階層一発で作成してみる(mkdir -p ちょっと応用)

Last updated at Posted at 2017-11-18

mkdir -p時にブレース展開する

現場でTipsを毎日書く習慣があって、mkdirを使用して複数階層のディレクトリを作れっていうのがあった。てことで備忘録としてこれやってみる。(といってもただのワンライナーだが…)

$ mkdir -p /tmp/hoge/{a1/a2,b1/b2/b3}
$ tree /tmp/hoge/                            
/tmp/hoge/                                                             
├ ─ ─  a1                                                              
│    └ ─ ─  a2                                                         
└ ─ ─  b1                                                              
    └ ─ ─  b2                                                          
        └ ─ ─  b3                                                      
                                                                       
5 directories, 0 files         
20
15
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?