- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Searching for files by date created
Categories
Company
Local Language
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
Discussions
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
Community
Resources
Forums
Blogs
- 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
02-22-2003 08:29 AM
02-22-2003 08:29 AM
Please i need to write a script that searches for files by date created or modified to enable me decide on which one to delete.
The problem is i dont know how to use grep or any other command to search for files by date created or modified.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2003 08:35 AM
02-22-2003 08:35 AM
Re: Searching for files by date created
Note that the modified time is most likely what you'll need since HP-UX does not keep track of the time the file was created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2003 08:55 AM
02-22-2003 08:55 AM
Re: Searching for files by date created
You can use 'find' with the 'newer' option:
For example, to find files modified/created on February 21, 203:
# touch 02202359 /tmp/ref1 ...Feb 20 at 2359
# touch 02220000 /tmp/ref2 ...Feb 22 at 0000
# find /tmp -xdev -type f \( -newer /tmp/ref1 -a ! -newer /tmp/ref2 \) | xargs ls -l
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2003 04:37 PM
02-22-2003 04:37 PM
Solutionlike
find ./ -mtine +2 -exec ll {}\;
to see the files older than 2 days in the current directory and
find ./ -mtine +2 -exec rm {}\ ; to delete thos files older than 2 days.
go through the man of find command to do more ..
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2003 08:28 AM
02-24-2003 08:28 AM
Re: Searching for files by date created
The find command is just wonderful. I have the script now and its working fine.
Gbenu