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