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
04-03-2003 08:03 AM
04-03-2003 08:03 AM
i want to delete from a directory all files of two day before. The issue is that files does not contain the date inside the name, so how to find which files to del?
I tried with
find . -atime +1 (to see files of yesterday) but this doesn't work.
Any tip?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 09:00 AM
04-03-2003 09:00 AM
Re: find
Try something like this :
find ~ -daystart -type f -mtime -2
HTH,
Goran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 09:03 AM
04-03-2003 09:03 AM
Re: find
can you paste out the output if it is short, or attach the output file if it is quite long?
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 11:15 AM
04-03-2003 11:15 AM
SolutionI used the 'touch' command with the date option to create several files with dates from the last few days, and then I used the find command with -atime to get files accessed from two days or older. Here is what I got:
$ ls -l
total 4
-rw-r--r-- 1 jpoff users 0 Mar 29 00:00 file1
-rw-r--r-- 1 jpoff users 0 Mar 30 00:00 file2
-rw-r--r-- 1 jpoff users 0 Mar 31 00:00 file3
-rw-r--r-- 1 jpoff users 0 Apr 1 00:00 file4
-rw-r--r-- 1 jpoff users 0 Apr 2 00:00 file5
-rw-r--r-- 1 jpoff users 0 Apr 3 00:00 file6
$ find . -atime +2
/file1
/file2
/file3
$ find . -atime +1
/file1
/file2
/file3
/file4
If that works for you, you should be able to do something like this to remove them:
find . -atime +2 -exec rm {} \;
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2003 12:12 AM
04-04-2003 12:12 AM
Re: find
i don't know. Yesterday that find statement didn't work, today yes. And i'm quite sure that there were files one day old.
However now it's ok. Thanks for your help.
Tarek