What's a fast way to count the number of html files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fusionx
    Confirmed User
    • Nov 2003
    • 4618

    #1

    What's a fast way to count the number of html files

    and images in a specific directory tree?

    On windows or linux..
  • Phoz
    Confirmed User
    • Aug 2002
    • 365

    #2
    search / *.html,*.jpg ?
    tinyurl.com/5a8cx

    Comment

    • fusionx
      Confirmed User
      • Nov 2003
      • 4618

      #3
      Originally posted by Phoz
      search / *.html,*.jpg ?
      I'm trying search -r ./ *.html

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

      Comment

      • rickholio
        Confirmed User
        • Jan 2004
        • 1914

        #4
        In linux:

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

        HTH. HAND.
        ~

        Comment

        • fusionx
          Confirmed User
          • Nov 2003
          • 4618

          #5
          Originally posted by rickholio
          In linux:

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

          HTH. HAND.
          Woohoo! Perfect - thanks much!

          Comment

          • rickholio
            Confirmed User
            • Jan 2004
            • 1914

            #6
            Originally posted by fusionx
            Woohoo! Perfect - thanks much!
            ~

            Comment

            • tungsten
              Too lazy to set a custom title
              • Mar 2004
              • 10579

              #7
              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!

              Comment

              • fusionx
                Confirmed User
                • Nov 2003
                • 4618

                #8
                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

                Comment

                • jayme_
                  Confirmed User
                  • Jan 2005
                  • 158

                  #9
                  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, 05:31 PM.

                  Comment

                  • rickholio
                    Confirmed User
                    • Jan 2004
                    • 1914

                    #10
                    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.
                    ~

                    Comment

                    • fusionx
                      Confirmed User
                      • Nov 2003
                      • 4618

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

                      Comment

                      Working...