in reply to Re: Using Perl saves time....
in thread Using Perl saves time....
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.
|
|---|