How does the -mtime option measure time?

The -mtime option in Unix/Linux is used with the find command to search for files based on their modification time. It measures time in days. Here's how it works:

  • -mtime n: Finds files modified exactly n days ago.
  • -mtime +n: Finds files modified more than n days ago.
  • -mtime -n: Finds files modified less than n days ago.

For example, to find files modified in the last 3 days, you would use:

find /path/to/directory -mtime -3

This command will list all files in the specified directory that were modified within the last 3 days.

0 Comments

no data
Be the first to share your comment!