SyntaxFix
Write A Post
Hire A Developer
Questions
If only names of regular files immediately contained within a directory (assume it's ~/dirs) are needed, you can do
~/dirs
find ~/docs -type f -maxdepth 1 > filenames.txt