ls > filenames.txt 列出本文件夹内文件 find ~/docs -type f -maxdepth 1 > filenames.txt 如果只需要在目录中立即包含的常规文件的名称,那么可以这样: