Look at the diffreent output of ls versus ls -1
$ ls
filea1.txt fileb.txt listB1.xml listC.xml
filea.txt listA1.xml listB.xml 'name with spaces 2.txt'
fileb1.txt listA.xml listC1.xml 'name with spaces.txt'
$ ls -1
filea1.txt
filea.txt
fileb1.txt
fileb.txt
listA1.xml
listA.xml
listB1.xml
listB.xml
listC1.xml
listC.xml
'name with spaces 2.txt'
'name with spaces.txt'
Which is quite OK for me. Thing go different if you redirect the output to file. I'd expect that file diffes, but they are identical.
$ ls -1>/tmp/ls-1.out
$ ls >/tmp/ls.out
$ cat /tmp/ls-1.out
filea1.txt
filea.txt
fileb1.txt
fileb.txt
listA1.xml
listA.xml
listB1.xml
listB.xml
listC1.xml
listC.xml
name with spaces 2.txt
name with spaces.txt
$ cat /tmp/ls.out
filea1.txt
filea.txt
fileb1.txt
fileb.txt
listA1.xml
listA.xml
listB1.xml
listB.xml
listC1.xml
listC.xml
name with spaces 2.txt
name with spaces.txt
Why is the latter just one-column output but not the multi-column as when there's no redirection to file?