Forrest logo
back to the find tool

find:ai:04b42

find sum of bytes of all files that are more than 180 days older and list them using ls
$ find . -type f -mtime +180 -exec ls -l {} + | awk '{sum += $5} END {print sum}'
try on your machine

This command uses find to locate all files in the current directory that are more than 180 days older. It then executes ls -l on each file and uses awk to sum up the size (in bytes) of all files. The resulting sum is printed.

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 of all files that are more than 180 days older and list them using ls ?
back to the find tool