Modifying the solution posted in edited post #1 to allow for an empty directory, a directory name containing space characters, or a directory containing subdirectories or other non-files:
ls -1d "${PWD}"/* 2>/dev/null | while read filename
do
if [ -f "${filename}" ]
then
echo "${filename}"
fi
done
Ps. Storing 150k files on one directory is a design issue. You can get severe performance issues or even failures.
We can only issue a "ls" command in such a directory if there are enough resources to sort the list (the unix "ls" command always sorts the list) and the o/s will tolerate the command.
If "ls" stops working, use "find" and a custom "sort".
Folowing Scrutinizer's excellent post, I revise as follows (untested): O/P did not specify ".txt" in posted solution.
printf "%s\n" "$PWD"/* | while read filename
do
if [ -f "${filename}" ]
then
echo "${filename}"
fi
done