JavaEar 专注于收集分享传播有价值的技术资料


  1. On my Fedora 10 system, with findutils-4.4.0-1.fc10.i386:

    find <path> -daystart -ctime 0 -print

    The -daystart flag tells it to calculate from the start of today instead of from 24 hours ago.

    Note however that this will actually list files created or modified in the last day. find has no options that look at the true creation date of the file.

  2. 参考答案2
  3. find . -mtime -1 -type f -print
  4. 参考答案3
  5. To find all files that are modified today only (since start of day only, i.e. 12 am), in current directory and its sub-directories:

    touch -t `date +%m%d0000` /tmp/$$
    find . -type f -newer /tmp/$$
    rm /tmp/$$


  6. 参考答案4
  7. You can't. @Alnitak's answer is the best you can do, and will give you all the new files in the time period it's checking for, but -ctime actually checks the modification time of the file's inode (file descriptor), and so will also catch any older files (for example) renamed in the last day.

  8. 参考答案5
  9. Just keep in mind there are 2 spaces between Aug and 26. Other wise your find command will not work.

    find . -type f -exec ls -l {} \; |  egrep "Aug 26";
  10. 参考答案6
  11. If you're did something like accidentally rsync'd to the wrong directory, the above suggestions work to find new files, but for me, the easiest was connecting with an SFTP client like Transmit then ordering by date and deleting.

  12. 参考答案7
  13. You can use find and ls to accomplish with this:

    find . -type f -exec ls -l {} \; |  egrep "Aug 26";

    It will find all files in this directory, display useful informations (-l) and filter the lines with some date you want... It may be a little bit slow, but still useful in some cases.