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

Re: Unix 101: ls with file count



Kent West wrote:
However, when I added ";ls | wc -l` Total Files'" to the end, I get a count of 16 directories, 8 files, and 25 Total Items. Something's not adding up.


D'oh! I added "ls -l" instead of "ls". When I fixed that, the count dropped back down to 24.

Kent



For me, echo `ls -l | wc -l` inflates the number by one because it
counts the total <bytes> line.  Are you sure the real source of the
discrepancy isn't that links aren't counted as either files or
directories with this method?


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: