linux
ls > filename.txt
--打印当前目录及子目录所有文件
find "$PWD" > print.txt
window dos
dir > filename.txt
--打印当前目录及子目录所有文件
dir /s /b > print.txt
Refs
How to send list of file in a folder to a txt file in Linux
How to create a text file list of the contents of a folder
How do I print a listing of files in a directory?
List files recursively in Linux CLI with path relative to the current directory