Web lists-archives.com

Re: question about ls




sorry! you're right.

after checking ls manual, i find ls has option -1


On Wednesday, September 26, 2018 6:52 AM, Long Wind <longwind2@xxxxxxxxx> wrote:


Thanks for your quick reply!

do you mean "ls -l | wc -l"
it should be letter l, not number 1


On Wednesday, September 26, 2018 6:34 AM, Ben Caradoc-Davies <ben@xxxxxxxxxxxx> wrote:


On 26/09/2018 10:27, Long Wind wrote:

> can ls show number of items in a folder?Thanks!


I use:

ls -1 | wc -l

To include items whose names start with ".", add the "a" or "A" argument
to ls ("man ls" for details).

For more advanced searches (recursive or filtering on file type), I use
find.

Kind regards.

--
Ben Caradoc-Davies <ben@xxxxxxxxxxxx>
Director
Transient Software Limited <https://transient.nz/>
New Zealand