Sponsored Content
Top Forums UNIX for Dummies Questions & Answers UNIX - command to count number of files in subdirectories Post 302893152 by blackrageous on Monday 17th of March 2014 03:23:31 PM
Old 03-17-2014
I did not test try something like...
Code:
cd test
find . -type -d | while read dirname
do
        count=`find ${dirname} -type f | wc -l`
        echo "${dirname}:${count}"
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Count number of files in subdirectories

Hello, I am new to unix and would like to have a count of all the files in the current directory as well as all the files in a subdirectory. The command I used was ls -R | wc -l but the number returned wasn't correct. Can someone please help? Thanks (2 Replies)
Discussion started by: cbeverly
2 Replies

2. UNIX for Dummies Questions & Answers

unix command to cound the number of files in a folder

Hi All Can some one help me out. Please tell the unix command to cound the number of files in a folder. Ungent please# Thanks manas (6 Replies)
Discussion started by: manas6
6 Replies

3. UNIX for Dummies Questions & Answers

Unix command to count the number of files with specific characters in name

Hey all, I'm looking for a command that will search a directory (and all subdirectories) and give me a file count for the number of files that contain specific characters within its filename. e.g. I want to find the number of files that contain "-a.jpg" in their name. All the searching I've... (6 Replies)
Discussion started by: murphysm
6 Replies

4. UNIX for Dummies Questions & Answers

Count number of files in directory excluding existing files

Hi, Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time.. Thanks (3 Replies)
Discussion started by: ammu
3 Replies

5. Shell Programming and Scripting

how can i find number of lines in files & subdirectories

how can i find number of lines in files & subdirectories ? (3 Replies)
Discussion started by: pcbuilder
3 Replies

6. UNIX for Dummies Questions & Answers

count files and subdirectories under /software

Dear All i need to find to total number of the files and subdirectories under /software i issue this command find /software/* -print | wc -l but i need another command to know how many files and subdirectories . (3 Replies)
Discussion started by: thecobra151
3 Replies

7. UNIX for Dummies Questions & Answers

Command for total number of files (and size) across subdirectories?

Hi all... I have a directory called dbrn. This directory contains an unknown number of subdirectories which in turn contain an unknown number of files. What I want to know is: How many files with extention .ABC can be found in /dbrn across all subdirecties, and what is the total size for... (9 Replies)
Discussion started by: Beun
9 Replies

8. UNIX for Dummies Questions & Answers

Rename a large number of files in subdirectories

Hi, I have a large number of subdirectories (>200), and in each of these directories there is a file with a name like "opp1234.dat". I'd like to know how I could change the names of these files to say "out.dat" in all these subdirectories in one go. Thanks! (5 Replies)
Discussion started by: lost.identity
5 Replies

9. Shell Programming and Scripting

How to count number of files in directory and write to new file with number of files and their name?

Hi! I just want to count number of files in a directory, and write to new text file, with number of files and their name output should look like this,, assume that below one is a new file created by script Number of files in directory = 25 1. a.txt 2. abc.txt 3. asd.dat... (20 Replies)
Discussion started by: Akshay Hegde
20 Replies

10. Shell Programming and Scripting

Count number of files

Hi All! I need to have a script that counts the number of files arriving in a landing directory, them some app pick these files to be processed and load to a DB. But this process is so fast that I am not able to count all the files arriving on a landing directory. Please can you help? My... (6 Replies)
Discussion started by: fretagi
6 Replies
BOGOTUNE(1)															       BOGOTUNE(1)

NAME
bogotune - find optimum parameter settings for bogofilter SYNOPSIS
bogotune [-v] [-c config] [-C] [-d dir] [-D] [-r value] [-T value] -n okfile [[-n] okfile [...]] -s spamfile [[-s] spamfile [...]] [-M file] bogotune [-h] DESCRIPTION
Bogotune tries to find optimum parameter settings for bogofilter. It needs at least one set each of spam and non-spam messages. The production wordlist is normally used, but it can be directed to read a different wordlist, or to build its own from half the supplied messages. In order to produce useful results, bogotune has minimum message count requirements. The wordlist it uses must have at least 2,000 spam and 2,000 non-spam in it and the message files must contain at least 500 spam and 500 non-spam messages. Also, the ratio of spam to non-spam should be in the range 0.2 to 5. If you direct bogotune to build its own wordlist, it will use the half the input or 2000 messages (whichever is larger) for the wordlist. Message files may be in mbox, maildir, or MH folder or any combination. Msg-count files can also be used, but not mixed with other formats. OPTIONS
The -h option prints the help message and exits. The -v option increases the verbosity level. Level 1 displays the scan output in detail instead of using a progress meter. The -c filename option tells bogofilter to read the config file named. The -C option prevents bogotune from reading a configuration file. The -d dir option specifies the directory for the database. See the ENVIRONMENT section for other directory setting options. The -D option tells bogotune to build a wordlist in memory using the input messages. The messages are read and divided into two groups. The first group is used to build a wordlist (in ram) and the second is used for tuning. To meet the minimum requirements of 2000 messages in the wordlist and 500 messages for testing, when -D is used, there must be 2500 non-spam and 2500 spam in the input files. If there are enough messages (more than 4000), they will be split evenly between wordlist and testing. Otherwise, they will be split proportionately. The -n option tells bogotune that the following argument is a file (or folder) containing non-spam. Since version 1.0.3, multiple arguments to the -n option can be given. All non-option arguments until the next -s option will be treated as though they had been preceded by -n The -s option tells bogotune that the following argument is a file (or folder) containing spam. It can be repeated as often as necessary. Since version 1.0.3, multiple arguments to the -s can be given. All non-option arguments until the next -n option will be treated as though they had been preceded by -s. The -r value option tells bogotune to use the following parameter as the robx value. The -T value option tells bogotune to use the following parameter as fp target value. The -M file option tells bogotune to convert the file to message count format. This format provides a sorted list of each message's unique tokens, along with their ham and spam counts. Sorting hides the sense of the messages quite effectively, thus protecting privacy. The message-count format allows bogotune and bogofilter to score messages quickly without needing the original token database. ENVIRONMENT
Bogofilter uses a database directory, which can be set in the config file. If not set there, bogofilter will use the value of BOGOFILTER_DIR. Both can be overridden by the -ddir option. If none of that is available, bogofilter will use directory $HOME/.bogofilter. BUGS
Bogotune is not particularly robust when presented with garbage input. AUTHOR
The bogofilter developer team. For updates, see the bogofilter project page[1]. SEE ALSO
bogofilter(1), bogolexer(1), bogoupgrade(1), bogoutil(1) NOTES
1. the bogofilter project page http://bogofilter.sourceforge.net/ 04/15/2008 BOGOTUNE(1)
All times are GMT -4. The time now is 03:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy