On 4/19/2011 3:05 PM, fbocch2595@xxxxxxx wrote:
> ls -lR | wc -l
This will give you more than just the number of files. It'll include
directories, plus it'll have extra lines for headings. (Which will add
to your count.)
I wouldn't use ls for this.
> find . -type f | wc -l
This will work better... but only includes "type f" (files). If that's
all you want, it's good.
> find -type f | wc -l
find: 001-3026 usage: find [-H | -L | -P] [-Xdx] [-f file] file ... [expression]
You've forgotten to specify the directory here. Syntax is:
find DIRECTORY -type f | wc -l
So this finds everything in the current directory (and it's subdirectories):
find . -type f | wc -l
And this finds everything in the /tmp directory (and it's subdirectories):
find /tmp -type f | wc -l
qsh: 001-0019 Error found searching for command du. No such path or directory.
There is no 'du' utility in QShell.
There's one in PASE, however... If you want to run the PASE one from
(or add /QOpenSys/usr/bin to your PATH. Or use QP2TERM instead of
QShell where it'll be in the path by default.)
Personally, I wouldn't use the -m flag. This causes the outputs to be
in megabytes, which will result in all of your small files being
unmeasurable. I'd probably use 'du -k' (kilobytes). But, I guess it
all depends on what you're looking for.