will count all files, inc those files that happen to be a directory themselves, in the current directory
ls -l | grep -v '^d' | wc -l
will exclude the directories Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
Not being picky Mike, but ls -l | grep -v ^d | wc -l will give you 1 more than the total files because of the "total nnn" shown by ls -l at the top of the list ...
you got me greg! <grin>
Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.