Python | shutil.disk_usage() method Last Updated : 07 Jun, 2019 Comments Improve Suggest changes Like Article Like Report Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Python’s standard utility modules. This module helps in automating process of copying and removal of files and directories. shutil.disk_usage() method in Python is to get disk usage statistics about the given path. This method returns a named tuple with attributes total, used and free. The total attribute represents the amount of total space, the used attribute represents the amount of used space and the free attribute represents the amount of available space, in bytes. Note: On Windows, the given path must represent a directory but on Unix systems, it can be a file or directory. Syntax: shutil.disk_usage(path) Parameter: path: A path-like object representing a file system path. A path-like object is either a string or bytes object representing a path. Return Type: This method returns a named tuple with attributed total, used and free. Code: Use of shutil.disk_usage() method Python3 # Python program to explain shutil.disk_usage() method # importing shutil module import shutil # Path path = "/home/User/Documents" # Get the disk usage statistics # about the given path stat = shutil.disk_usage(path) # Print disk usage statistics print("Disk usage statistics:") print(stat) Output: Disk usage statistics: usage(total=244934381568, used=13350301696, free=219070689280) Reference: https://docs.python.org/3/library/shutil.html Comment More infoAdvertise with us Next Article Python | shutil.disk_usage() method I ihritik Follow Improve Article Tags : Python python-utility Practice Tags : python Similar Reads Python | shutil.unpack_archive() method Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Pythonâs standard utility modules. This module helps in automating process of copying and removal of files and directories.shutil.unpack_archive() method in Python is used to un 2 min read Python | shutil.copy() method Python3 # Python program to explain shutil.copy() method # importing shutil module import shutil # Source path source = "/home/User/Documents/file.txt" # Destination path destination = "/home/User/Documents/file.txt" # Copy the content of # source to destination try: shutil.copy( 5 min read Python | shutil.which() method Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Pythonâs standard utility modules. This module helps to automate the process of copying and removal of files and directories. shutil.which() method tells the path to an executab 2 min read Python | shutil.chown() method Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Pythonâs standard utility modules. This module helps in automating process of chowning and removal of files and directories.shutil.chown() method in Python is used to change the 3 min read Python | shutil.copy2() method Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Pythonâs standard utility modules. This module helps in automating process of copying and removal of files and directories.shutil.copy2() method in Python is used to copy the co 4 min read Python | shutil.copyfile() method Shutil module in Python helps automate the process of copying and removing files and directories. It comes under Pythonâs standard utility modules. Shutil(short for shell utility) module also provides many functions of high-level operations on files and collections of files. What is Shutil.copyfile 4 min read Python | shutil.copystat() method Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Pythonâs standard utility modules. This module helps in automating process of copying and removal of files and directories.shutil.copystat() method in Python is used to copy the 3 min read Python | shutil.copymode() method Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Pythonâs standard utility modules. This module helps in automating the process of copying and removal of files and directories.shutil.copymode() method in Python is used to copy 2 min read Python | shutil.move() method Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Pythonâs standard utility modules. This module helps in automating the process of copying and removing files and directories. The shutil.move() method moves a file or directory 2 min read Python | shutil.get_unpack_formats() method Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Pythonâs standard utility modules. This module helps in automating process of copying and removal of files and directories. shutil.get_unpack_formats() method in Python is used 2 min read Like