Traverse a directory tree and output a list of all files Write the shortest code that traverses a directory tree and outputs a flat list of all files.


It should traverse the whole directory tree
The order in which it enters sub-directories doesn't matter
The directories should not be output
The output should be a plain list — the definition is flexible, but it shouldn't contain irrelevant data
You are free to use any programming technique
find 14 characters (12 on GNU)

find . -type f


Run this in the directory you want to list. Add -printf '%f\n' to only print names without the path.

Non-portable: find -type f.