Problems with find command

Folks,

I have been searching a dir for specfic files that have been accessed within a certain timeframe. The issue that I am having is that it picks up the .snapshot dir as well.

I am using the following:

find /probecards/ -name "S25E3N*" -mtime -1 -type f

Is this correct or how do I get it to ignore the ,snapshot files?

I have tried different methods to do this but always with the same results

Rgds

Colin

Samba-AD:/tmp/test # find . -path './stuff' -prune -o -name hi
./.skip/hi
./stuff
Samba-AD:/tmp/test # find . -path './.skip' -prune -o -name hi
./.skip
./stuff/hi
find /probecards/ -name "S25E3N*" -mtime -1 -type f | grep -v .snapshot

Using the command above is it possible to show what host last accesssed the file?

First off, "-mtime" uses the modification time. You spoke about "access time" above, which would make the "-atime" clause correct - check if what you do is what you want.

The next thing would be analogously with -ctime and -atime: my find (AIX 5.3, ML 06) is NOT understanding "-mtime -1" because "-1" would be treated as a separate option. It understands "-mtime +1" (everything more than 1 day ago) and "-mtime 1" (everything up to one day ago). I don't know, but i suppose your find doesn't find what you think it finds either.

Now to your last question: no, you can't find out which process or host has last accessed the file. The reason is these times (mtime, atime, ctime) are stored in the inode of the file as timestamps. Information about what was the cause for creation, modification or access is not stored, only the time in form of a timestamp. If you "touch" (man touch) a file for instance the mtime gets changed to the current system time, but no information about touch being responsible for that change is stored.

bakunin