3 ms·
Although it often doesn't get printed like that, shells do consider the output of `ls` to be multiple lines. Try doing `ls > foo.txt` and looking at the output
by saghm 10y ago
Although it often doesn't get printed like that, shells do consider the output of `ls` to be multiple lines. Try doing `ls > foo.txt` and looking at the output file (or more directly, `ls | wc -l`).
- jjnoakes 10y agoThat isn't the shell considering the output one per line. ls will change the way it writes its output if it detects that stdout is a tty versus a pipe or redirect.