Shell – How to create a structured list of all the files and directories under a particular directory (recursively)

directoryfileslsshell

I need to have an "image" of a file system without actual contents of the files – just all the names and the structure, so that I can read the file and know what files were stored there and how were they located. As always in these kinds of cases, I tend to believe that there is a beautiful "Unix way" to achieve this with a combination of some standard GNU command-line utilities. Am I right? What is it?

Best Answer

Like find / -type f > /tmp/list_of_all_the_files.txt ?