There are several commands out there that will help you list the contents of a directory, such as;
There are also recursive options that you can apply that will give you the subdirectory listings and it’s contents such as:
and so on. However, these options not only list the file name and sometimes only a partial path, but they also include file or directory rights as well as time stamps.
If all you seek is a listing of the contents of a folder and its subdirectories as well as the file name without all that other good stuff then try the following command.
find / -print.
This command will give you a listing of all your computer files, output right on your terminal.
What if we only want to list the contents of a particular directory. Then type the following:
find /home/user/directory_to_be_search -print
If you want to save the results to a text file, then simply add “> textfile.txt” to the end of your command.
find /home/user/directory_to_be_search > /home/user/documents/directory_listing.txt
this will output my results to a text file in my documents folder named directory_listing.txt that will contain the list of all documents and their paths found in /home/user/directory.
Any questions or comments, please post.