Sort the filenames

Hello Unix experts:
I have dir where few files are there, i want to sort these files and write the output to some other file but i need filenames with filepath too
eg:

i have filenames like

010020001_S-FOR-Sort-SYEXC_20171218_094256_0004.txt

so i want to sort my files on first 5 fields of filenames, i tried this command

ls -1| sort > sort.txt

i got the sorted output in sort.txt but its just filename..how can i append filepath to each filename and if possible provide me better solution for sort.

TIA

Would

ls -1d $(pwd)/*

workl?

There isn't any real need to invoke an external utility for this. One could also try:

printf "$PWD/%s\n" * > sort.txt

as long as the pathname of your current working directory doesn't contain contain any <percent-sign> or <backslash> characters, or if the pathname could contain some of those characters:

for fn in *
do	printf '%s/%s\n' "$PWD" "$fn"
done > sort.txt