Printing a folders contents to a text file

Hey y’all…
Can anyone tell me in Linux, how to get the contents of a folder to print off a text or document file? Thanks for any help in advance,

I don’t understand your question. Can you give us a simple example?

You mean like

ls > file.txt

from terminal???