Wolfram Computation Meets Knowledge

DirectorySize

Contributed by: Arnoud Buzing

Total size of a directory

ResourceFunction["DirectorySize"]["dir"]

returns the byte count for “dir” as a quantity.

Details and Options

The total includes the content of all subdirectories.

Examples

Basic Examples

Get the size of the current working directory:

In[1]:=
ResourceFunction["DirectorySize"][Directory[]]
Out[1]=

Find the size of the Wolfram System installation directory:

In[2]:=
ResourceFunction["DirectorySize"][$InstallationDirectory]
Out[2]=

Properties and Relations

Empty directories have zero bytes:

In[3]:=
ResourceFunction["DirectorySize"][CreateDirectory[]]
Out[3]=

Resource History