- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find command - file modification date
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-2003 04:26 AM
12-17-2003 04:26 AM
find command - file modification date
find /u01/app/oasist/pbin/*.log -mtime -1 -exec ls -la {} \;
but it's giving me a listing of files from today and yesterday.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 04:27 AM
12-17-2003 04:27 AM
Re: find command - file modification date
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 05:19 AM
12-17-2003 05:19 AM
Re: find command - file modification date
maic_dev2:/u01/app/oasist/pbin> find /u01/app/oasist/pbin/*.log -mtime +5 -exec ls -la {} \;
-rwxr-xr-x 1 oasis dba 0 Apr 11 2002 /u01/app/oasist/pbin/bill_eng.log
I'd like to only get/remove the file from yesterday, December 16th.
-rw------- 1 root sys 15092 Dec 16 20:23 /u01/app/oasist/pbin/12_16_103.log
-rw-r--r-- 1 oasis dba 875 Dec 17 10:19 /u01/app/oasist/pbin/12_17_103.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:08 AM
12-17-2003 06:08 AM
Re: find command - file modification date
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:12 AM
12-17-2003 06:12 AM
Re: find command - file modification date
ll -ct|grep -i "Dec 16"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:13 AM
12-17-2003 06:13 AM
Re: find command - file modification date
maic_dev2:/u01/app/oasist/pbin> find /u01/app/oasist/pbin/*.log -mtime +1 -exec ls -la {} \;
-rwxr-xr-x 1 oasis dba 0 Apr 11 2002
maic_dev2:/u01/app/oasist/pbin> find /u01/app/oasist/pbin/*.log -mtime +5 -exec ls -la {} \;
-rwxr-xr-x 1 oasis dba 0 Apr 11 2002 /u01/app/oasist/pbin/bill_eng.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:15 AM
12-17-2003 06:15 AM
Re: find command - file modification date
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:17 AM
12-17-2003 06:17 AM
Re: find command - file modification date
how about this:
# find /u01/app/oasist/pbin/*.log -type f \( -mtime +0 -a -mtime -2 \) -exec ls -ltr {} \;
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:18 AM
12-17-2003 06:18 AM
Re: find command - file modification date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:20 AM
12-17-2003 06:20 AM
Re: find command - file modification date
maic_dev2:/u01/app/oasist/pbin> find /u01/app/oasist/pbin/*.log -type f \( -mtime +0 -a -mtime -2 \) -exec ls -ltr {} \;
maic_dev2:/u01/app/oasist/pbin>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:28 AM
12-17-2003 06:28 AM
Re: find command - file modification date
export YESTERDAY=$(TZ=$(date +%Z)+24; date '+%b %e')
ll|grep -i ${YESTERDAY}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:33 AM
12-17-2003 06:33 AM
Re: find command - file modification date
maic_dev2:/u01/app/oasist/pbin> ll|grep -i ${YESTERDAY}
grep: can't open 16
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:42 AM
12-17-2003 06:42 AM
Re: find command - file modification date
ll|grep -i "${YESTERDAY}"
note double quotes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:44 AM
12-17-2003 06:44 AM
Re: find command - file modification date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:47 AM
12-17-2003 06:47 AM
Re: find command - file modification date
# find /u01/app/oasist/pbin/*log -mtime 1 -exec ls -al {} \;
Note the "1" and not +1 or -1. This what each one of it will do:
1 - between 24 and 48 hours old
+1 - 48 hours or older
-1 - within 24 hours
Please remember that -mtime calculates times in 24 hours and not in actual *days* as we calculate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 06:50 AM
12-17-2003 06:50 AM
Re: find command - file modification date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 10:44 AM
12-17-2003 10:44 AM
Re: find command - file modification date
This is the find command I use for a daily cleanup of one of out /tmp directories.
find /tmp/ -type f -mtime -1 > output_file
This is for all files within the last 24 hours.
To eliminate today's:
grep -v "date '+%b %m'" output_file > delete_file
Of course your cript will have to sed or cut the file name field.
Best of luck.
Regards,
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2004 07:16 AM
02-11-2004 07:16 AM
Re: find command - file modification date
-rw-r--r-- 1 rahxgb users 3552 Apr 4 2000 mailqmon.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2004 07:24 AM
02-11-2004 07:24 AM
Re: find command - file modification date
- Dan