Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-05-2005, 03:29 PM   #1
fusionx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Olongapo City, Philippines
Posts: 4,618
What's a fast way to count the number of html files

and images in a specific directory tree?

On windows or linux..
fusionx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 03:31 PM   #2
Phoz
Confirmed User
 
Join Date: Aug 2002
Location: tinyurl.com/5a8cx
Posts: 365
search / *.html,*.jpg ?
__________________
tinyurl.com/5a8cx
Phoz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 03:37 PM   #3
fusionx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Olongapo City, Philippines
Posts: 4,618
Quote:
Originally Posted by Phoz
search / *.html,*.jpg ?
I'm trying search -r ./ *.html

it's giving me "*.html - no such file or directory"
fusionx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 03:47 PM   #4
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
In linux:

find /path/to/root/directory -name *.html | wc -l

HTH. HAND.
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 03:50 PM   #5
fusionx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Olongapo City, Philippines
Posts: 4,618
Quote:
Originally Posted by rickholio
In linux:

find /path/to/root/directory -name *.html | wc -l

HTH. HAND.
Woohoo! Perfect - thanks much!
fusionx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 03:50 PM   #6
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
Quote:
Originally Posted by fusionx
Woohoo! Perfect - thanks much!
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 04:28 PM   #7
tungsten
Too lazy to set a custom title
 
Join Date: Mar 2004
Posts: 10,579
Quote:
Originally Posted by rickholio
In linux:

find /path/to/root/directory -name *.html | wc -l

HTH. HAND.
was looking for such code as well, thanks
__________________
  • VOYEUR /HOMEMADE, HENTAI / CARTOON, Reality, Amateur, Shemale, Hardcore, Cuckold, Celebrity, Retro/Vintage, ect...ALL OUR SITES >>
  • Unbelievable Ratio | High % of Rebills | Bi-Monthly Payments (also to E-Passporte)
  • Ton's of EXCLUSIVE Free content & FHG's |=> GREAT REVENUE $$$ GUARANTEED!
tungsten is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 07:24 PM   #8
fusionx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Olongapo City, Philippines
Posts: 4,618
Quote:
Originally Posted by rickholio
In linux:

find /path/to/root/directory -name *.html | wc -l

HTH. HAND.
Still here? How can I make this recurse the subdirectories under /path/to/root?

I tried using -mindepth 3 and it didn't seem to make any difference. I've got 98 subdirs and don't want to cd and run this in all of them
fusionx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 07:29 PM   #9
jayme_
Confirmed User
 
Industry Role:
Join Date: Jan 2005
Location: new york city
Posts: 158
cd /path/to/root
find . -name "*.html" -print | wc -l

the "." should work, dont forget the quotes "*.html"

Last edited by jayme_; 03-05-2005 at 07:31 PM..
jayme_ is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 07:58 PM   #10
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
Quote:
Originally Posted by fusionx
Still here? How can I make this recurse the subdirectories under /path/to/root?

I tried using -mindepth 3 and it didn't seem to make any difference. I've got 98 subdirs and don't want to cd and run this in all of them
This should automatically descend into all subdirectories. For example:

find /usr -name *jpg | less

yields:

/usr/share/gtk-2.0/demo/background.jpg
/usr/share/doc/pygtk2-2.4.0/examples/pygtk-demo/demos/images/background.jpg
/usr/share/doc/mod_perl-1.99_16/docs/user/handlers/filter_life_shower.jpg
/usr/share/doc/mod_perl-1.99_16/docs/user/handlers/filter_life_player.jpg
/usr/share/doc/mod_perl-1.99_16/docs/user/handlers/filter_life_goggles.jpg
/usr/share/doc/mod_perl-1.99_16/docs/user/handlers/filter_life_mask.jpg
..etc...

Notice that the root was /usr. It'll find everything underneath... additionally, you can run the command from anywhere. If you need to count the files instead of seeing them, just pipe the output through 'wc -l' (word count, linecount only).

HTH.
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-05-2005, 10:45 PM   #11
fusionx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Olongapo City, Philippines
Posts: 4,618
Quote:
Originally Posted by rickholio
This should automatically descend into all subdirectories. For example:

Notice that the root was /usr. It'll find everything underneath... additionally, you can run the command from anywhere. If you need to count the files instead of seeing them, just pipe the output through 'wc -l' (word count, linecount only).

HTH.
Thanks again - it's working fine now. It only was showing the current directory earlier. I must have missed something

So.. I just uploaded 2,033 HTML pages and 3,684 jpgs. Search engines love that kind of thing..
fusionx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.