ls -al | wc -l
Philippe
Oops I forgot the recursive mode :
ls -alR | wc -l
Philippe
not with 'ls' but should do:
find . | wc -l
The problem here is that you're going to be counting "." and "..", too.
To the OP: Why does it have to be with ls? find and/or du would be much
better for this purpose.
--
Ken
Real address krgray*at*verizon*dot*net
You can fix that by using 'ls -AlR | wc -l'. But there are still blank
lines and lines giving totals. You can eliminate the totals by changing
the command to 'ls -A1R | wc -l' (the `l` changes to a one). The find
command given in another posting is better, but there is still one extra
line (the one listing just .).
>To the OP: Why does it have to be with ls? find and/or du would be much
>better for this purpose.
>
>--
>Ken
>
>Real address krgray*at*verizon*dot*net
--
Tom Schulz
sch...@adi.com
> You can fix that by using 'ls -AlR | wc -l'. But there are still blank
> lines and lines giving totals. You can eliminate the totals by changing
> the command to 'ls -A1R | wc -l' (the `l` changes to a one). The find
> command given in another posting is better, but there is still one extra
> line (the one listing just .).
you are right, the following should skip the '.'
find . | tail +2 | wc -l