Web lists-archives.com

Re: question about ls




On Thu, Sep 27, 2018 at 07:55:56AM -0500, Kent West wrote:
> 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

But also note that using ls -l gives a completely wrong answer.

wooledg:~$ mkdir /tmp/x && cd "$_"
wooledg:/tmp/x$ touch $'this\nis\none\nfile'
wooledg:/tmp/x$ ls -l | wc -l
5

Thus, <https://mywiki.wooledge.org/BashFAQ/004>.