Solved

"find -mtime" differences AIX4 and AIX5

Posted on 2003-11-10
6
4,000 Views
Last Modified: 2013-12-06
Hi!

The definition of "find -mtime" changed!

find all files changed between 24-48 hours
AIX4: find . -mtime 2
AIX5: find . -mtime 1

find all files changed between 48-72 hours
AIX4: find . -mtime 3
AIX5: find . -mtime 2

find all files changed between 0-24 hours
AIX4: find . -mtime 1
AIX5: find . -mtime 0

find all files changed between 0-48 hours
AIX4: find . -mtime -2
AIX5: ???
AIX5: find . -mtime -1 -> returns all files changes between 24-48
AIX5: find . -mtime -2 -> returns all files changes between 24-72

BUT HOW TO find all files between 0 and 48/72/... hours???

thx
michi
0
Comment
Question by:witty
  • 3
6 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 9719366
Here's what you can do, create a stamp file first, than use find.
eg, to find all the files 0-72 hrs, you do: (I use ksh/bash/sh shell systax)

STAMP=`TZ=$TZ+72 date  +%Y%m%d%H%M`
touch -t $STAMP mystamp

find . -newer mystamp -print
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9736303
how's it going, need more help?
0
 
LVL 1

Author Comment

by:witty
ID: 9741145
@yuzh:

thanks for your comment:
... but creating a temporary file is no solution :-(
any other idea?

thx
michi
0
 
LVL 38

Accepted Solution

by:
yuzh earned 125 total points
ID: 9744409
Well, I have not used an AIX box for a while now, and don't have AIX 5.x on hand
for testing:

In normal condition:

find . -mtime -n
should return all the files modified in 0 - n*24 hours (this working fine in Solaris,
HP-UX, FreeBDS, Linux, SCO ....!)

If "find" behave the way as you mentioned above,  you better use a tmp file.
(it cost you nothing 0 byte, if you use it in a script, you can clean it up
after "find"),  otherwise, you have to use "for/while" loop, to do multiple "find"!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Samsung memory install did'nt recognize by new hardware 5 25
Linux : adding the new user with password option, 11 97
Oracle Finace 3 66
Image not there 4 44
Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now