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

Re: dir command



Manon Metten wrote:

Is there a bash command available that shows the contents of the given dir recursively, telling me how many files are in there and the byte size occupied?


For the total number of files:
$ find . -type f | wc -l

For the total number of directories:
$ find . -type d | wc -l

To get sizes, du is the obvious choice, but you
could do the ridiculous:
$ find . -type f -exec cat {} \; | wc -c





Reply to: