Forrest logo
back to the find tool

find:ai:dc91a

find sum of bytes in GB of all files that are more than 180 days older and list them using ls
$ find ${directory} -type f -mtime +180 -ls | awk '{SUM += $7} END {print SUM/1024/1024/1024}' | jq -R .
try on your machine

This command finds all files in the specified directory that are more than 180 days older, lists the files using 'ls' command, calculates the sum of their sizes in gigabytes, and outputs the result as a JSON string.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.

Questions that are answered by this command:

  • find sum of bytes in GB of all files that are more than 180 days older and list them using ls ?
back to the find tool