This is a simple Python script on Linux which is used to traverse the directories and files, determine the size of the directories, and generate a disk usage statistics report in CSV format. Module sys.argv
is used to access the terminal command line.
To run the script, follow the steps below:
- Set up virtual environment
~$ virtualenv env
- Activate virtual environment
~$ source env/bin/activate
- Install dependencies
~$ pip install -r requirements.txt
- Run script
~$ ./disk_report.py /TARGET_DIRECTORY/