Unix filesystem look up
Ho开发者_开发知识库w to get the list of all the files and folders in the root dir including sub-folders and their files.
or this: find /
If you want to do it programmatically I'd recommend readdir() and opendir().
Try this (with Ewan's modification):
ls -R /
man find
In all seriousness though,
find / -maxdepth 2
That should show you the root directory, folders in /, and the contents of those folders. If you want the subdirectories of the subdirectories, use -maxdepth 3, and so on.
use find command eg
$ find /path -print
or if you have tree installed
$ tree /path
精彩评论