> 
> On Thu, 12 Aug 1999, Richard Adams wrote:
> > > 
> > ls -al /lib/modules/`uname -r`/* | wc -l
> > subtracht 4 lines for every directory, that will then show the amount of
> > modules.
> > 
> 
> can you clarify "every directory." does this mean sub-directories
> in the ./uname -r/ directory? Does it include that directory?

Firstly let me appolagise for not realy explaing properly, that is because i
am lying in bed beacuse of my back which does not function as it should
thesedays and the medicine i am taking slows my reactions down to a snails
pace and leaves me in such a state where i have be very carefull what i type,
hence the tremendous amount of spelling mistakes.

The command ls -al /lib/modules/`uname -r`/* | wc -l will produce a complete
list of all directorys and files under uname -r in my case 2.2.5-16

A few lines as an example are;

/# ls -al /lib/modules/`uname -r`/* | more
-rw-r--r--   1 root     root         9646 Aug 12 13:49 /lib/modules/2.2.5-
16/modules.dep

/lib/modules/2.2.5-16/block:
total 164
drwxr-xr-x   2 root     root         1024 Jul 27 08:27 .
drwxr-xr-x   9 root     root         1024 Jul 27 09:55 ..
-rw-r--r--   1 root     root        68340 Jul 27 09:55 floppy.o
-rw-r--r--   1 root     root        31328 Jul 27 09:55 ide-cd.o
-rw-r--r--   1 root     root        12948 Jul 27 09:55 ide-floppy.o
-rw-r--r--   1 root     root        26760 Jul 27 09:55 ide-tape.o
-rw-r--r--   1 root     root        11016 Jul 27 08:27 loop.o
-rw-r--r--   1 root     root         8396 Jul 27 08:27 nbd.o


The first line is modules.dep which is not a module so the - count is now 1
from the total which wc -l will produce.

the next 4 lines are /lib/modules/2.2.5-16/block
total 164 and the directory ownership, 
They also are not modules, so we deduct another 4 lines from the total
count.
So further we deduct 4 lines for every directory under uname -r.

A beter command would have been;

ls -al /lib/modules/`uname -r`/* | grep -e "-rw-r--r--" | wc -l
That produces 168 which includes modules.dep so - 1 = 167 modules.

> 
> eg. I am using kernel 2.2.10. in  my /lib/modules/2.2.10 directory
> are six subs. do I subtract 6 from the wc count or 7? or are you
> counting some other directories altogether?
> 
> --
> Keith Robinson
> kmail 1.0.024
> RH Linux 6.0
> 


-- 
Regards Richard.
[EMAIL PROTECTED]

Reply via email to