HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Removing files from a directory
Operating System - HP-UX
1834213
Members
2402
Online
110066
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
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
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
12-29-2003 12:36 AM
12-29-2003 12:36 AM
Hello,
I have a Oracle database server and there is a directory with a log files updating regularly.I just want to search those files in with the date-wise and need to delete the logfiles files morethan 20 days old files.
And this is going to run as a cron daemon,this is part is perfect.
Please provide me a logic to solve the above issue.
If anything require more. please let me know.
Thanks & Regards
Balaji
I have a Oracle database server and there is a directory with a log files updating regularly.I just want to search those files in with the date-wise and need to delete the logfiles files morethan 20 days old files.
And this is going to run as a cron daemon,this is part is perfect.
Please provide me a logic to solve the above issue.
If anything require more. please let me know.
Thanks & Regards
Balaji
THE WORD IMPOSSIBLE ITSELF SAYS I'MPOSSIBLE
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 12:43 AM
12-29-2003 12:43 AM
Solution
balaji,
When you mean the log files are they archive log files or the oracle trace log files.
Make sure and think twice that those files are not needed.
you can just do a
#find -type f -name -mtime +20 -print
list them
#find -type f -name "*.log" -mtime +20 -exec ll {} \;
Remove
#find -type f -name "*.log" -mtime +20 -exec rm {} \;
When you mean the log files are they archive log files or the oracle trace log files.
Make sure and think twice that those files are not needed.
you can just do a
#find
list them
#find
Remove
#find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 12:43 AM
12-29-2003 12:43 AM
Re: Removing files from a directory
Hi Balaji,
The first is to list the files in the directory, the second to remove the files.
# find /your_dir -mtime +20 -exec ls -l {} \;
# find /your_dir -mtime +20 -exec rm {} \;
Hope this helps,
Robert-Jan.
The first is to list the files in the directory, the second to remove the files.
# find /your_dir -mtime +20 -exec ls -l {} \;
# find /your_dir -mtime +20 -exec rm {} \;
Hope this helps,
Robert-Jan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 02:00 AM
12-29-2003 02:00 AM
Re: Removing files from a directory
Also, you can see the files in reverse chronological order (date-wise) with the command "ls -lt | more" (lower case ell and lower case t).
=:-) Alex
=:-) Alex
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP