Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2004
    Posts
    44

    How to list all files/directories that are newly modified?

    Hey guys,

    What is the shell command (linux) to list all files and subdirectories that are newly modified, or modified after a certain date?

    I can't seem to figure it out.

    Thanks!

    - Ticky.

  2. #2
    Join Date
    Oct 2003
    Location
    New Jersey
    Posts
    32
    find /path/to/dir -mtime 1
    Will find all files in /path/to/dir with modification times within the last 24 hours ( 1 = 24 hours)

    find /path/to/dir -mmin 1
    will find all files in /path/to/dir with modification times within the last 1 minute

    for more control see
    man find
    note -amin, -atime, -cmin, -ctime, -mmin, -mtime, -newer
    Cybersalad.net
    A substance almost but
    not quite utterly unlike salad

  3. #3
    Join Date
    Apr 2003
    Location
    San Jose, CA.
    Posts
    1,624
    too slow :p

  4. #4
    Join Date
    Apr 2003
    Location
    San Jose, CA.
    Posts
    1,624
    Originally posted by salad
    find /path/to/dir -mmin 1
    will find all files in /path/to/dir with modification times within the last 1 minute

    Actually.. that would only find files modified exactly 1 minute in the future. ?

    find /path/to/dir -mmin -1
    will find all files in /path/to/dir with modifiication times within the last 1 minute.

  5. #5
    Join Date
    Oct 2003
    Location
    New Jersey
    Posts
    32
    yer right - I gave bad info -

    within the last minute
    find /path/to/dir -mmin -1

    exactly a minute ago
    find /path/to/dir -mmin 1

    more than a minute ago
    find /path/to/dir mmin +1
    Cybersalad.net
    A substance almost but
    not quite utterly unlike salad

  6. #6
    Join Date
    Mar 2005
    Location
    Cardiff, Wales, UK
    Posts
    46
    you can also use the -type argument to specifiy just files (f) or just directories (d)

    fine -type f -mmin -1 // find just files modified in the last minute
    Jonathan Wright (Technical Director, JAB Web Solutions Limited).

    UK Hosting and Reseller Hosting from JAB Web Solutions

  7. #7
    Join Date
    Apr 2003
    Location
    San Jose, CA.
    Posts
    1,624
    Yeah but he did say he wanted it to find both, "What is the shell command (linux) to list all files and subdirectories "

  8. #8
    Join Date
    Mar 2005
    Location
    Cardiff, Wales, UK
    Posts
    46
    yeah i know

    I just thought I'd pass on these words of wisdom I find them most useful when working my way around linux
    Jonathan Wright (Technical Director, JAB Web Solutions Limited).

    UK Hosting and Reseller Hosting from JAB Web Solutions

Posting Permissions

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