Operating System - OpenVMS
1753740 Members
3905 Online
108799 Solutions
New Discussion юеВ

Re: total size of files under a directory

 
Swain
Regular Advisor

total size of files under a directory

is there any command for getting size of all the files in a directory or its subdirectories?
e.g. all the files list with their size that exist in MUM$DKA400:[USERS]

7 REPLIES 7
Karl Rohwedder
Honored Contributor

Re: total size of files under a directory

What is wrong with
DIREC /SIZE[=all][/Total][/GRAND]

regards Kalle
Steven Schweda
Honored Contributor

Re: total size of files under a directory

> [...] or its subdirectories [...]

> DIREC /SIZE[=all][/Total][/GRAND]

MUM$DKA400:[USERS...]
Jan van den Ende
Honored Contributor

Re: total size of files under a directory

Amaresh,

Steven gave the answer that is usually correct.
However, there is one detail that needs to be checked.
_IF_ any of the directories has an alias, _THEN_ all of it and its subdirectories are counted again (and again for multiple aliasses).

Now, your syntax of MUM$DKA400:[USERS] seems to make that unlikely, as it SUGGESTS that the nodename is MUM and the device is the one that carries the PHYSICAL identification of DKA400, but I have several times into situations where the application device name (here "MUM$DKA400:" ) is a redefinition of SYS$SYSROOT (a practise I most strongly DISAPPROVE of, but you find what you find...) and THEN my first paragraph applies.

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Swain
Regular Advisor

Re: total size of files under a directory

Thanks a lot for the early response.
One more query: Could I sort the output by size of files?
Hoff
Honored Contributor

Re: total size of files under a directory

>Could I sort the output by size of files?

Not directly; not with the base system.

With the default OpenVMS tools you can select (rather than sort) by a specified size. DIRECTORY /SELECT = SIZE = MINIMUM = value is probably the most useful of these.

There are add-on tools which can provide various sort orders for directory listings, or you can combine existing tools akin to the following (by date) example:

http://h71000.www7.hp.com/wizard/wiz_7290.html

It can also be feasible to use gnv or other such, and use the bash shell (which allows you to do this sort of thing) as an alternative to DCL.

Kris Clippeleyr
Honored Contributor

Re: total size of files under a directory

Amaresh,


One more query: Could I sort the output by size of files?


You could use QDSB. Works (almost) like DIRECTORY. To be downloaded from:

http://www.quadratrix.be/qdsb.html

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
John Travell
Valued Contributor

Re: total size of files under a directory

Within its limits the following command may be helpful, clearly you can create your own permutation...
$ pipe dir/col=1/wid=file=40/size | sort sys$pipe /key=(pos:40,siz:9) sys$output

JT: