> For the complete documentation index, see [llms.txt](https://til.yulrizka.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.yulrizka.com/unix/file-size-older-than-x-days.md).

# file size older than x days

from <http://stackoverflow.com/a/17419690/546750>

to list all file that modified more than more than X days, we can use

```
$ find . -mtime +[number of days]
```

if you use `-` sign than it became file is modified since X days

Combine it with akw, we can get total file size

```
$ find . -mtime +180 -exec du -ks {} \; | cut -f1 | awk '{total=total+$1}END{print total/1024}'
```
