GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   What's a fast way to count the number of html files (https://gfy.com/showthread.php?t=440361)

fusionx 03-05-2005 03:29 PM

What's a fast way to count the number of html files
 
and images in a specific directory tree?

On windows or linux..

Phoz 03-05-2005 03:31 PM

search / *.html,*.jpg ?

fusionx 03-05-2005 03:37 PM

Quote:

Originally Posted by Phoz
search / *.html,*.jpg ?

I'm trying search -r ./ *.html

it's giving me "*.html - no such file or directory"

rickholio 03-05-2005 03:47 PM

In linux:

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

HTH. HAND. :thumbsup

fusionx 03-05-2005 03:50 PM

Quote:

Originally Posted by rickholio
In linux:

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

HTH. HAND. :thumbsup

Woohoo! Perfect - thanks much!

rickholio 03-05-2005 03:50 PM

Quote:

Originally Posted by fusionx
Woohoo! Perfect - thanks much!

:thumbsup

tungsten 03-05-2005 04:28 PM

Quote:

Originally Posted by rickholio
In linux:

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

HTH. HAND. :thumbsup

was looking for such code as well, thanks

fusionx 03-05-2005 07:24 PM

Quote:

Originally Posted by rickholio
In linux:

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

HTH. HAND. :thumbsup

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 :)

jayme_ 03-05-2005 07:29 PM

cd /path/to/root
find . -name "*.html" -print | wc -l

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

rickholio 03-05-2005 07:58 PM

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.

fusionx 03-05-2005 10:45 PM

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


All times are GMT -7. The time now is 03:59 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123