[SunRescue] finding a number of files in a dirB

Peter Koch koch at pz.pirmasens.de
Wed Feb 23 02:36:34 CST 2000


Hi!

>I hadn't thought of ls' awareness of I/O redirection.
>...is anyone familiar with a way to prevent it from doing that?

Yes, you can use the option -C.
And this might be the reason why  "ls | wc -l" can fail...
if there is some "alias ls ls -CF" around.

I prefer "/bin/ls | wc -l". Works in most cases and prevents
alias expansion.

If you use "ls -al" or "ls -Al", you get some EXTRA lines, which
do not show a file! Try it! You'd have to do some:

	"ls -Al | tail +2 | wc -l"

Much too much to type ;-)

Tschuess

Peter






More information about the rescue mailing list