The output of the
ls utility may differ depending on whether the output is being written directly to a terminal, or to a pipe.
You will get the same behaviour as with
tr '\n' \n' if you use
file-00 file-01 file-02 file-03 file-04 file-05 file-06 file-07 file-08 file-09
$ ls | cat
This behaviour, listing one file per line, is the default output of
ls described by the POSIX standard for this utility:
The default format shall be to list one entry per line to standard output; the exceptions are to terminals or when one of the
-x options is specified. If the output is to a terminal, the format is implementation-defined.
You will also notice the single quotes around your
#recycle filename "disappearing" when the output is filtered through a pipe. In fact, these were never part of the filename, but just the way GNU
ls decided to render the name when outputting it to a terminal (based on what characters the name contains; the
# is considered "special"). The single quoted name and the output in columns is an "implementation-defined format" permitted by the standard when the output is going to terminal.
Replacing the pipe with a redirection to a file (or to a process substitution in shells that supports these) would also make
ls format its output in the "default format", with each filename delimited by a newline character.