He used -1 which gives you one item per line, not -l which stats the files

Of course, under most OSes, when you pipe ls into something, it implies ls -1, so it streams faster, as opposed to trying to determine how many columns to build. (I've not used AIX, so it's possible that it doesn't do this).

I would, however, recommend using the -l flag to wc, so that it only needs to count the lines, and not the words and characters as well.

And most ufs systems choke hard on ls when you have too many items in a directory. I saw a poorly set up system, that was rolling its log files each minute (it might've been one per transaction). The backups were failing, because it took more than 24 hrs for it to generate the listing of the directory with more than 2 million entries ... so the next backup would start running before the first one had finished.


In reply to Re^2: Using Perl saves time.... by jhourcle
in thread Using Perl saves time.... by szabgab

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.