Number of items in a directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Number of items in a directory
# 1  
Old 12-19-2008
Number of items in a directory

This should be so simple.. I have folder with about 27 subfolders in it, each folder has a number of fonts in it.. how do I get the total number of fonts for all subfolders?
# 2  
Old 12-19-2008
Assuming no embedded newlines in the filenames:

Code:
find . -type f|wc -l

# 3  
Old 12-19-2008
Assuming that your fonts have the extension .ttf
Code:
find . -type f -name '*.ttf' -print | wc -l

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

Number of Small Forum Code Changes (TODO List Items)

In the past few days have I have done a lot of code cleanup work in various categories, including faster page loading and bug fixes: Move countless inline style directives to external CSS stylesheets for key pages (faster page loading) Fixed bug in member panel going between desktop and... (6 Replies)
Discussion started by: Neo
6 Replies

2. 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

3. Shell Programming and Scripting

Counting the number of readable, writable, and executable items in a directory

Hello, I'm writing a script in sh in which the first command line argument is a directory. from that, i'm suppose to count the number of readable, writable, and executable items in the directory. I know using $1 represents the directory, and ls would display all the items in the directory, and that... (4 Replies)
Discussion started by: kratos22
4 Replies

4. Shell Programming and Scripting

Delete a directory after X number of days

Hi How do I remove a directory which are some days old . For Ex : $ cd /WMID/data/temp/TxTest/Dev/txStore $ ls -ltr total 0 drwxr-xr-x 3 wmethods wmapp 80 Jul 21 03:36 0AE445C4 drwxr-xr-x 3 wmethods wmapp 80 Jul 21 04:00 0AE44664 drwxr-xr-x 3 wmethods... (6 Replies)
Discussion started by: leo76
6 Replies

5. Shell Programming and Scripting

Number of files per directory

Hi Guys, I am trying to display the total number of files within a directory (including sub dirs): i.e. solaris> du -sh * | sort +0rn 1009K cron 940K lib 849K svc 489K cacao 261K opt 212K preserve 167K dt But instead of the size I would like the number of files... (9 Replies)
Discussion started by: flexinfo
9 Replies

6. Shell Programming and Scripting

Store number in a directory

hi all, this is some code in c...i want to write script for this... for(i=0;i<10;i++) { store i in backup directory; } (1 Reply)
Discussion started by: AbhijitIT
1 Replies

7. Shell Programming and Scripting

awk between items including items

OS=HP-UX ksh The following works, except I want to include the <start> and <end> in the output. awk -F '<start>' 'BEGIN{RS="<end>"; OFS="\n"; ORS=""} {print $2} somefile.log' The following work in bash but not in ksh sed -n '/^<start>/,/^<end>/{/LABEL$/!p}' somefile.log (4 Replies)
Discussion started by: Ikon
4 Replies

8. UNIX for Dummies Questions & Answers

Number of files in a directory

I have a directory which has lots of directories and files in it. I want to determine the total number of files in the top level directory (inclduing the files in sub-dirs) Is there a unix command of that ?/ Thanks !!! (3 Replies)
Discussion started by: tantric
3 Replies

9. Shell Programming and Scripting

Number of files in a particular directory

Hi, I am new to unix shell scripting.I am using Korn shell. I need to find if there are any files in a particular directory.first I need to find the number of files in the directory.If the file count is greater than 0 then I have to print the file names in a textfile and send an email to the... (5 Replies)
Discussion started by: dbplatha
5 Replies
Login or Register to Ask a Question