A collection of practical Python scripts for file management, automation, system administration, and other useful tasks.
This repository contains a wide variety of standalone Python scripts that automate common tasks such as file and directory operations, archiving, logging, disk usage checks, and more. Each script is self-contained with descriptive filenames and in-code documentation.
-
File Management:
- List all files and folders in a directory
- Move files based on type
- Sort files into subfolders by extension
- Count files by extension
- Backup files by copying
- Delete files older than a certain age
-
Archiving & Compression:
- Archive log files older than 30 days
- Zip and unzip directories
-
System Operations:
- Check disk usage
- Get system information
- Use Python's
logging
module
-
Basic File I/O:
- Read a file line by line into a list
- Write to and reopen files
Each script is independent. You can run any script using:
python <script-name.py> [arguments]
Refer to the comments at the top of each script for usage instructions and required arguments.
- Python 3.x
- Some scripts require additional modules (e.g.,
psutil
,shutil
). Install dependencies as needed.
Feel free to submit issues or pull requests to add new scripts or improve existing ones.
- GitHub: saghosh8
This repository is a growing collection. Contributions and suggestions are welcome!