- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: File census
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-04-2006 05:18 AM
02-04-2006 05:18 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2006 05:26 AM
02-04-2006 05:26 AM
Re: File census
use
find / -mtime <720=days old> -exec rm {} \;
starts form /
if specific
then
find /don -mtime 720 -exec rm {} \;
use mtime for modified time and
atime for access time.
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2006 05:29 AM
02-04-2006 05:29 AM
Solution'find' is your friend for this. See its manpages for more details.
# find /path -xdev -type f -mtime +120 | xargs ls -l
...will search /path not cross any mountpoints (-xdev), look only for files (-type f) that have not been modified in 120-days or more (-mtime +120) and pipe any of the names found to 'ls -l' to offer you a full long-listing.
You can change the 'ls -l' to 'rm' if you are satisfied that you want to remove all of those candidates.
# find /path -xdev -type f -mtime +120 | xargs ls -l
Similarly, to find all files whose size is greater than 100,000 characters, do:
# find /tmp -xdev -type f -size +100000c | xargs ls -l
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2006 05:31 AM
02-04-2006 05:31 AM
Re: File census
Sorry my 1st one will remove all.
use
find / -mtime +720 -print
the above will print files more than 720 days old.
find you want that in a file
then
find / -mtime +720 -print >> /tmp/720days_files
find / -size +nk 2000 -print
prints size more that 2M
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2006 02:22 PM
02-05-2006 02:22 PM
Re: File census
# find / -type f -mtime +45 -exec ls -l {} \;
It will list files who are elder that 45 days.
Based on size,
# find / -type f -exec du {} \; | xargs sort -rnk 1
--
Muthu