I'm unable to remove space from filenames as below, Please advise if any solution is there on this issue. thank you
/home/files:
Dec 14 22:10 testfiles
Dec 15 12:30 test file1
Dec 14 21:45 test file2
Dec 16 02:30 testfile3
$ ls -lrt| tr -s " " > filelist.txt
$ cat filelist.txt
2022-12-14,testfiles
2022-12-15,test
2022-12-14,test
2022-12-16,testfile3
ls
command that you are using does not provide the output that you present, not Eve when passed throughtr
like you show. It is unclear whether the exercise is to modify a text file, or whether it to modify some filenames. It is further unclear whether the dates that you show are significant in any way (are they, for example, part of the filenames)? There is also commas introduced in the last shown data, and I don't know where these come from. – Kusalananda Dec 21 '22 at 14:44