On 26/09/2018 10:55, Long Wind wrote:
> sorry! you're right.
> after checking ls manual, i find ls has option -1
Note also that ls will behave like it has the "-1" option if its output
is piped to another command, even without this option. I like to use the
"-1" option even in this case because it is what I mean (counting
entries one per line).
But also note the difference when using the letter "l" vs the numeral "1":
westk@westkbox:/opt$ ls -la | wc
7 56 321
westk@westkbox:/opt$ ls -1a | wc
6 6 54
The difference is that the letter includes the total count of blocks used at the top of the list (adding one to the count), whereas the numeral does not.