Linux: create random directory/file hierarchy

前端 未结 4 1431
[愿得一人]
[愿得一人] 2020-12-28 23:52

For testing a tool I need a directory with a whole bunch of different Office files in a deep nested structure. I already have the files in a directory, but now need to creat

4条回答
  •  不知归路
    2020-12-29 00:15

    You can use bash brace-expansion:

    mkdir -p {a,b}/{e,f,g}/{h,i,j}
    

    ├───a
    │   ├───e
    │   │   ├───h
    │   │   ├───i
    │   │   └───j
    │   ├───f
    │   │   ├───h
    │   │   ├───i
    │   │   └───j
    │   └───g
    │       ├───h
    │       ├───i
    │       └───j
    └───b
        ├───e
        │   ├───h
        │   ├───i
        │   └───j
        ├───f
        │   ├───h
        │   ├───i
        │   └───j
        └───g
            ├───h
            ├───i
            └───j
    

提交回复
热议问题