Bursa Bilgisayar

Linux Under Find Files Modified On Specific Date

Hello everyone;

How do I find out all files that have been modified on 2013-02-07 (07/Feb/2013) using find command under Linux / Apple OS X / *BSD and Unix like operating systems?

There are two ways to list files in given directory modified after given date of the current year. The latest version of GNU/find command use the following

Code:

Syntax

GNU/find latest version:

find /path/to/dir -newermt "date"
find /path/to/dir -newermt "Feb 07"
find /path/to/dir -newermt "yyyy-mm-dd"

## List all files modified on given date

find /path/to/dir -newermt yyyy-mm-dd ! -newermt yyyy-mm-dd -ls

### print all *.pl ###

find /path/to/dir -newermt "yyyy-mm-dd" -print -type f -iname "*.pl"

Sample photo:

find-newermt-option

The other way of doing this works on the versions of find before v4.3.3:

touch -t 02010000 /tmp/stamp$$
find /usr -newer /tmp/stamp$$
rm -f /tmp/stamp$$

Example

To find out all files that have been modified on 2013-02-07 (07/Feb/2013), enter:

find /path/to/dir -type f -name "*" -newermt 2013-02-07 ! -newermt 2013-02-08

Sample outputs:

./output/tmp/rss.js-gzip-10881623-407-1360173602
./images/bursa-bilgisayar.php
./images/faq/2013/02/ir-150x150.jpg
./images/faq/2013/02/warning-40px76.png

To find out all Python files (*.py) in /home/vivek/projects that have been modified on 2013-02-07 (07/Feb/2013),

enter:

find $HOME/projects -type f -name "*.py" -newermt 2013-02-07 ! -newermt 2013-02-08 -print

Pass the -ls option to get detailed file listing:

find $HOME/projects -type f -name "*.py" -newermt 2013-02-07 ! -newermt 2013-02-08 -ls

To find and delete all tmp files (*.tmp) in /home/bursa/projects that have been modified on 2013-02-07 (07/Feb/2013), enter:

find $HOME/projects -type f -name "*.py" -newermt 2013-02-07 ! -newermt 2013-02-08 -delete

Bursa-Bilgisayar.Com Seeu.

Related posts

453 thoughts on “Linux Under Find Files Modified On Specific Date

  1. It is orbiting above me, and has some sort of metallic
    light onn the outdoors.” Then the object flew off and vanished.

  2. Woah! I’m really digging the template/theme of this
    website. It’s simple, yet effective. A lot of times it’s hard to get that “perfect balance” between superb usability and visual
    appeal. I must say you’ve done a amazing job with
    this. Also, the blog loads very fast for me on Chrome.
    Exceptional Blog!

  3. you’re actually a just right webmaster.
    The site loading velocity is incredible. It sort of feels that you are doing anny unique trick.
    In addition, The contents are masterwork. you’ve performed a magnificent process in this
    subject!

  4. Oh my goodness! Incredible article dude! Thanks, However I am experiencing problems with your RSS. I don’t understand the reason why I am unable to subscribe to it. Is there anyone else having the same RSS issues? Anyone who knows the solution can you kindly respond? Thanks!!|

Bir Cevap Yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

 Characters available