in reply to Re: how to get total numbers of files in a directory?
in thread how to get total numbers of files in a directory?

Easier method for one directory is ofcourse
ls /home/a/*.txt |wc -l
But learning find is definedly worth it as well :).

UPDATE:
Duh, was *.txt. Double duh, ls goes wild if dir name matches as well, so be careful. Find tends to be easier to keep under control :P.

Replies are listed 'Best First'.
Re: Re: Re: how to get total numbers of files in a directory?
by Anonymous Monk on Dec 09, 2003 at 19:02 UTC
    to avoid ls wildness and to get a true listing of all files ( some versions of ls, like hp-ux, put multiple files on one line ) do ls -ald /home/a/*.txt | wc -l And Find is also your Friend.