Recursively List all directories and files

后端 未结 7 1764
萌比男神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:03

    Bash/Linux Shell

    Directories:

    find ./ -type d 
    

    Files:

    find ./ -type f 
    

    Bash/Shell Into a file

    Directories:

    find ./ -type d  > somefile.txt
    

    Files:

    find ./ -type f  > somefile.txt
    

提交回复
热议问题