# Delete files by  year

**URL:** <https://community.unix.com/t/delete-files-by-year/276184>\
**Category:** UNIX for Dummies Questions & Answers\
**Created:** [October 27, 2010, 12:13am UTC](https://community.unix.com/t/delete-files-by-year/276184 "2010-10-27T00:13:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lhareigh890](https://community.unix.com/letter_avatar/lhareigh890/32/5_5575768a8748004e209b776fc1b2916d.png) [@lhareigh890](https://community.unix.com/u/lhareigh890)\
**Post date:** [October 27, 2010, 12:13am UTC](https://community.unix.com/t/delete-files-by-year/276184/1 "2010-10-27T00:13:33Z")

</div>

can someone provide a command to delete files by year? I have several files created last year 2009.

Im trying to list first ls -lrt | grep '/2009/ {print $10}' by it returns no result.

Pls advise

---

<div class="post-metadata">

**Author:** ![malcomex999](https://community.unix.com/letter_avatar/malcomex999/32/5_5575768a8748004e209b776fc1b2916d.png) [@malcomex999](https://community.unix.com/u/malcomex999)\
**Post date:** [October 27, 2010, 1:52am UTC](https://community.unix.com/t/delete-files-by-year/276184/2 "2010-10-27T01:52:29Z")

</div>

How does your ls -lrt looks like...

```nohighlight
 
ls -lrt | awk '$8 ~ /2009/{print $9}'

```

---

<div class="post-metadata">

**Author:** ![pludi](https://community.unix.com/user_avatar/community.unix.com/pludi/32/1278_2.png) [@pludi](https://community.unix.com/u/pludi)\
**Post date:** [October 27, 2010, 3:28am UTC](https://community.unix.com/t/delete-files-by-year/276184/3 "2010-10-27T03:28:32Z")

</div>

Create 2 files with timestamps for 2008-12-31 and 2009-12-31, and then use [man find (POSIX)](https://www.unix.com/man-pages.php?query=find&section=0&os=POSIX)'s -newer option, eg:

```plaintext
touch -t 200812312359.59 oldest
touch -t 200912312359.59 newest
find / -type f -newer oldest \! -newer newest -print

```
