- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find older files in a folder by specific date
Operating System - HP-UX
1822895
Members
3469
Online
109645
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2007 06:33 PM
тАО04-22-2007 06:33 PM
Dear All,
I have a folder and sub folder, where there are more than 1000 files. The oldest file is one year old. I want to delete files that are more than 6 months old.
1) How can i find those files?
2) How can i delete those files?
Please help.
Regards
Shafi
I have a folder and sub folder, where there are more than 1000 files. The oldest file is one year old. I want to delete files that are more than 6 months old.
1) How can i find those files?
2) How can i delete those files?
Please help.
Regards
Shafi
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2007 07:23 PM
тАО04-22-2007 07:23 PM
Solution
Shafi,
how about:
find /dir -xdev -ctime +183 -type f -exec rm {} \;
But, I would recommend running the command below FIRST, to check the list of files that will be removed:
find /dir -xdev -ctime +183 -type f -exec ls -l {} \;
/dir would be the location of the directories.
Please read "man find" for further info.
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
how about:
find /dir -xdev -ctime +183 -type f -exec rm {} \;
But, I would recommend running the command below FIRST, to check the list of files that will be removed:
find /dir -xdev -ctime +183 -type f -exec ls -l {} \;
/dir would be the location of the directories.
Please read "man find" for further info.
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2007 07:38 PM
тАО04-22-2007 07:38 PM
Re: find older files in a folder by specific date
Hi Shafi,
Try this command ,this will list the oldfile modified before 186 days.
find -mtime +186 -exec ll {} \;
Try this command ,this will list the oldfile modified before 186 days.
find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2007 08:05 PM
тАО04-22-2007 08:05 PM
Re: find older files in a folder by specific date
Dear all,
Thanks for your help. I actually found the following commands very usefull.
find ./ ! -newer /tmp/timeref -exec ls {}\;
Here /tmp/timeref file is the reference file which has the time stamp.
Thanks for your help. I actually found the following commands very usefull.
find ./ ! -newer /tmp/timeref -exec ls {}\;
Here /tmp/timeref file is the reference file which has the time stamp.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP