List files recursively in Kotlin
Use one of .walk(…), .walkBottomUp() or .walkTopDown() extensions for File, which differ only in the order in which the files appear and all produce a FileTreeWalk, that implements Sequence<File>: File(“/tmp”).walkTopDown().forEach { println(it) }