WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Find command advice for finding all files of a specific date and time range  (Read 2171 times)

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Does anyone know how to modify this command to cover a range in the seconds field. Let's say over a 5 second range. A better command would of course be appreciated.

Code: [Select]
sudo find . -type f -print0 | xargs -0 sh -c 'for i in "$@"; do if stat "$i" | grep -q "^Modify: 2009-05-25 16:39:43.000000000"; then echo "$i"; fi; done'
Note I want to be able to enter any date and time as the starting point (not a relative date as in mtime).
« Last Edit: May 25, 2009, 04:37:58 PM by bigpcman »
big pc man

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Let me see, if I understand. You want to enter any date and time and find all files over the complete filesystem within 5 seconds based on the Modify attribute?
10+ Years Contributing to Linux Open Source Projects.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Let me see, if I understand. You want to enter any date and time and find all files over the complete filesystem within 5 seconds based on the Modify attribute?

Yes, within a 5 second range.

edit: I use -prune in the find command to narrow the search to avoid the tmp/tcloop area.
« Last Edit: May 25, 2009, 09:09:36 PM by bigpcman »
big pc man