This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Directory to analyze | |
directory="/path/to/directory" | |
# Initialize an associative array to store the storage per year | |
declare -A storage_per_year | |
# Loop through all files in the directory | |
find "$directory" -type f -exec stat --format "%Y %s" {} \; | while read -r timestamp size; do |