如何在linux中计算嵌套目录内的文件数?

use*_*818 0 linux scripting bash directory files

我需要提取一些目录树中有多少文件的信息:

  /.../testRoot/test1/test11/..../file1
  /.../testRoot/test1/test11/file2
  /.../testRoot/test1/test11/..../file3
  /.../testRoot/test1/test11/file4
.....................................
  /.../testRoot/test1/test1n/fileq
  /.../testRoot/test1/test1n/..../filew
  /.../testRoot/test1/test1n/filee
  /.../testRoot/test1/test1n/.../.../ .../filer
Run Code Online (Sandbox Code Playgroud)

如何计算testRoot中有多少个文件?

小智 10

find /path/to/testRoot -type f | wc -l