Find Biggest File in Directory Tree

The following cross-platform Python script allows you to search for the biggest file within a directory and all its subfolders (the search is recursive). The directory path must be passed as the first argument when invoking the script. Additionally, a second argument indicating a file extension can optionally be passed to limit the search.
For example, to find the biggest file inside C:\Python310
and its subfolders, run in the terminal:
py find_biggest_file.py C:\Python310
To find the largest Python (.py
) file:
py find_file.py C:\Python310 .py
On macOS and Linux distributions, use python
or python3
instead of py
.
Donate ❤️
Found our post useful? You can support us with a little donation!
Comments