# Removing old folders

**URL:** <https://community.unix.com/t/removing-old-folders/160936>\
**Category:** UNIX for Dummies Questions & Answers\
**Created:** [April 7, 2006, 10:59am UTC](https://community.unix.com/t/removing-old-folders/160936 "2006-04-07T10:59:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeepakXavier](https://community.unix.com/letter_avatar/deepakxavier/32/5_5575768a8748004e209b776fc1b2916d.png) [@DeepakXavier](https://community.unix.com/u/DeepakXavier)\
**Post date:** [April 7, 2006, 10:59am UTC](https://community.unix.com/t/removing-old-folders/160936/1 "2006-04-07T10:59:00Z")

</div>

All

Please help me to remove old files. For example

/usr/exp/ - inside this

Apr 02 - dir02  
Apr 03 - dir03  
Apr 04 - dir04  
Apr 05 - dir05  
Apr 06 - dir06  
Apr 07 - dir07  
Apr 03 - file03

I want to delete all the folders 2 days before created.Not the fil03 even though it is 2 days old.

Please help me to write shell script. Iam working in AIX.

Thanx in advance

Regards  
Deepak Xavier

---

<div class="post-metadata">

**Author:** ![amro1](https://community.unix.com/letter_avatar/amro1/32/5_5575768a8748004e209b776fc1b2916d.png) [@amro1](https://community.unix.com/u/amro1)\
**Post date:** [April 7, 2006, 11:19am UTC](https://community.unix.com/t/removing-old-folders/160936/2 "2006-04-07T11:19:57Z")

</div>

I'm just a bit confused by the description, but generally spealking you prpbably need something like that below. Tweek it according to you requirements:  
find /usr/exp/ -ctime +2 | xargs rm  
"UNIX Essentials and Core" DVD explains it.
