The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 10-25-2008 12:37 PM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 06:47 AM
find: problems escaping printf-command string grahamb Shell Programming and Scripting 1 12-04-2005 04:00 PM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 06:38 PM
how to find a file in UNIX without find command? bluo Shell Programming and Scripting 3 09-24-2003 11:47 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-26-2007
lodey lodey is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 29
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
  #2 (permalink)  
Old 10-26-2007
Radar's Avatar
Radar Radar is offline
Registered User
  
 

Join Date: Dec 2006
Location: Clifton Park, NY
Posts: 86
Code:
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
  #3 (permalink)  
Old 10-26-2007
earnstaf earnstaf is offline
Registered User
  
 

Join Date: May 2007
Posts: 113
Quote:
Originally Posted by lodey View Post
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
Code:
find /probecards/ -name "S25E3N*" -mtime -1 -type f | grep -v .snapshot
  #4 (permalink)  
Old 10-27-2007
lodey lodey is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 29
Using the command above is it possible to show what host last accesssed the file?
  #5 (permalink)  
Old 10-27-2007
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,628
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0