Recursively List all directories and files

后端 未结 7 1780
萌比男神i
萌比男神i 2021-01-30 20:19

I would like to receive the following output.

Suppose the directory structure on the file system is like this:

  -dir1
      -dir2
        -file1
        -fi         


        
7条回答
  •  走了就别回头了
    2021-01-30 21:23

    In windows, to list only directories:

    dir /ad /b /s
    

    to list all files (and no directories):

    dir /a-d /b /s
    

    redirect the output to a file:

    dir /a-d /b /s > filename.txt
    

    dir command parameters explained on wikipedia

提交回复
热议问题