How-To get a directory count
I did a search and finally found out how to get the file count in various ways with-in a direcory. These works very well on FreeBSD current-9.0:
ls | wc -l # count files and one for each directories in the current (target) directory. find /target/directory -type f -print | wc -l # count all files in all directories, but exclude directories count find /target/directory -maxdepth 1 -type f -print | wc - # all files, in given directory only.
My questions is:
1) How do we get the count of all directories only with-in a directory.
2) and than how to get a list of all directory names with-in a given directory.
Thanks in advance
|Thread||Thread Starter||Forum||Replies||Last Post|
|How is SSL hopelessly broken? Let us count the ways||J65nko||News||0||12th April 2011 01:17 AM|
|Xtracting Data after Fragmentation / Block Count / Partition Problems on Boot||IronForge||OpenBSD Installation and Upgrading||3||16th December 2010 12:09 AM|
|FreeBSD 7.2@amd64 atheros problem ath0: stuck beacon; resetting (bmiss count 4)||asmo||FreeBSD General||0||6th June 2009 11:02 AM|
|strange "~" directory in home directory||gosha||OpenBSD General||5||23rd February 2009 05:12 PM|
|how to copy a directory.||bsdnewbie999||OpenBSD General||1||12th July 2008 02:36 PM|