ls -1a | wc | awk '{printf("There are %s files in this directory!\n",$1-2)}'
Note, that's a 1 (one) not an l (el) in the ls.... And if you don't want to
count hidden files, then remove then use this:
ls -1 | wc | awk '{printf("There are %s files in this directory!\n",$1)}'
Of course, you can put it in a batch file (filenun, for example), put it
in your path, and use it anywhere...
Bill Ward
-----Original Message-----
From: Adam Sleight [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 14, 2000 11:26 PM
To: [EMAIL PROTECTED]
Subject: count # files in directory
can't think today...how doe one count the number of files within a
directory...yes I know du, df, and wc for words in a file.
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list