- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Find command problem
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
06-23-2005 06:12 AM
06-23-2005 06:12 AM
Is there any way I can use this old find command to find files less than x minutes old or is there another command that may do this directly or indirectly?
Thanks, Jayson
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 06:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 06:21 AM
06-23-2005 06:21 AM
Re: Find command problem
touch markerfile -t MMDDhhmm
ls -rt > /tmp/tempfile
markerloc=`grep -n markerfile /tmp/tempfile | cut -d: -f1`
sed -e "1,${markerloc}d" /tmp/tempfile > /tmp/filelist
this procedure has gaping holes in it as it does not check against any errors but can give you a good idea how to tackle the problem.
hope it helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 06:54 AM
06-23-2005 06:54 AM
Re: Find command problem
# find
this will search all files that are less than x minutes old.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 06:54 AM
06-23-2005 06:54 AM
Re: Find command problem
Then you can manipulate outputfile with grep (i.e. grep "Jun 24" outputfile ) to narrow it down a bit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 07:49 AM
06-23-2005 07:49 AM
Re: Find command problem
Man this would be so easy if my 'find' command were new enough to use the -mmin command...
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 08:35 AM
06-23-2005 08:35 AM
Re: Find command problem
Say you want to find files with a time stamp after 1:30PM today
# touch -t 06231330 afile
(man touch for more info.)
# find /dir -newer afile
That will find files that are newer than the file afile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 08:44 AM
06-23-2005 08:44 AM
Re: Find command problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 09:21 AM
06-23-2005 09:21 AM
Re: Find command problem
Use it like this:
#!/usr/bin/sh
typeset TMSPEC=''
typeset TDIR=${TMPDIR:-/var/tmp}
typeset REFFILE=${TDIR}/X${$}_1.ref
TMSPEC=$(timestamp.pl -p 300) # 300 seconds before now
touch -m -t ${TMSPEC} ${REFFILE}
# your find stuff goes here
rm -f ${REFFILE} # clean up after yourself
Here's the Perl attachment, timestamp.pl;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 11:59 AM
06-23-2005 11:59 AM
Re: Find command problem
To find files that were created in the last few
minutes. The time given is just a example on how the command will work.
#touch -t 0304290900 test
This will create a file with time stamp of 4/29/2003 and time of 9:00 AM.
#find /home -newer test
This will search /home for files that have a newer time stamp of 9:00 AM.
For example, if user /home/bob touched/edited a file at 9:01 AM on 4/29/03,
then the output would return the file that Bob modified.
Regards
Vinod K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2005 01:42 PM
06-23-2005 01:42 PM
Re: Find command problem
I have a logic, if you are good in scripting
1. Get a list of files modified in a day by find command and store in todaysfiles
2. Grep list of files modified on hour basis
e.g. grep "Jun 22 22:" todaysfiles
will give you files modified between 22:00 to 22:59.
if you still want to fine tune, you can use awk command compare hour first and then compare time with separate variables.
Cheers!!!
eknath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2005 03:55 AM
06-24-2005 03:55 AM
Re: Find command problem
Thanks to all!