- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: To find files which have not been modified (ac...
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
12-17-2006 11:23 PM
12-17-2006 11:23 PM
How can we find the files which have not been modified or accessed for the last 10 days ?
Is there any specific command to do this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2006 11:27 PM
12-17-2006 11:27 PM
SolutionFiles which have not been modified in the last 10 days:
$ find /path -type f -mtime +10 -print
Files which have not been accessed in the last 10 days:
$ find /path -type f -atime +10 -print
$ man 1 find
for more information.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2006 02:55 AM
12-18-2006 02:55 AM
Re: To find files which have not been modified (accessed) in the last 10 days
/usr/bin/find /tmp -type f -mtime +5 -exec rm -r {} \;
/usr/bin/find /var/tmp -type f -mtime +5 -exec rm -r {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2006 03:40 AM
12-18-2006 03:40 AM
Re: To find files which have not been modified (accessed) in the last 10 days
You need to use the find command. There are two flags to consider, -atime and -mtime. The first lets you find based on access time and the latter on modify time. So you need to decide which you want to use.
We use the below to remove log files
find /log_directory -name logfile.* -atime +10 -exec {} \;
HTH
Berd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2006 02:25 PM
12-18-2006 02:25 PM
Re: To find files which have not been modified (accessed) in the last 10 days
This is missing "rm". It also should be changed to use the "+" syntax for performance:
find /log_directory -name "logfile.*" -atime +10 -exec rm -f +