Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Posts
    12

    Unanswered: How to list files modifed within the last 1/2 hour?

    Hi all,

    I need to find a list of files that have been modifed within the last 30 minutes. This seems like such a simple thing but I am having trouble doing this.

    The mtime value on the find command only evaluates by the day, ie.+1 is within the last 24 hours, +2 is within the last 48 hours, etc. I couldn't find and options on the ls command which would work either.

    Any help will be greatly appreciated!

    Thanks

  2. #2
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    man touch - pay attention to the '-t' option
    man find - pay attention to the '-newer' option
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  3. #3
    Join Date
    May 2004
    Posts
    12

    confused....

    I saw that command but that requires you pass it a file as a value to test against. I want to list files up to 30 minutes OLDER than the current time? Any more hints....???

  4. #4
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    HINT:
    create a file [/tmp/pivot.txt] with 'touch -t <time> /tmp/pivot.txt' where 'time' is 30 minutes BEHIND current time
    use 'find -newer /tmp/pivot.txt' to list files created within the 30 mins window from 'current'
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  5. #5
    Join Date
    May 2004
    Posts
    12

    hate to be so helpless but..... r/o

    I am having a hard time figuring out how to code in a script to create a file (I can do that) and then check the current time (I can do that) but then determine the time for 30 minutes prior to the current time. Any ideas? Thank you so much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •