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