[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: number of files in directory?



Thomas Adam wrote:
--- Lance Hoffmeyer <lance@augustmail.com> wrote:
How can I get a count of the number of files in a directory?
directory + subdirectoies?


Crudely:

ls -1 | wc -l

(note the "-1" option to 'ls' is hyphen-one, NOT lower-case L, which is
what the option to 'wc' is).

Note, too, that the "-1" option is not deeded, as ls detects that stdout
isn't a terminal, and it wil use one-collumn output with or without the "-1".

--
Groetjes
joostje
1f1c8cdd94ddb3264368a4ec8c8369f4-592b9df7b0a20369a50b47f8db73f8b635bc637c



Reply to: