What is "-mtime 0" option in find command. Does it consider the files that are of today lets say today is 4th Aug or will include files 24 hrs past from the current time????
"-atime/-ctime/-mtime" [+|-]n Each of those specifies selection of the files based on three Unix timestamps: the last time a files's "access time", "file status" and "modification time".
n is time interval -- an integer with optional sign. It is measured in 24-hour periods (days) or minutes (GNU find only) counted from the current moment.
n: If the integer n does not have sign this means exactly n 24-hour periods (days) ago, 0 means today.
+n: if it has plus sing, then it means "more then n 24-hour periods (days) ago", or older then n,
-n: if it has the minus sign, then it means less than n 24-hour periods (days) ago (-n), or younger then n. It's evident that -1, and 0 are the same and both means "today".
Note: If you use parameters with find command in scripts be careful when -mtime parameter is equal zero. Some (earlier) versions of GNU find incorrectly interpret the following expression
find -mtime +0 -mtime -1 which should be equivalent to find -mtime -1 but does not produce any files
Source: softpanorama.org/Tools/Find/find _mini_tutorial.shtml
methyl
August 4, 2010, 8:42am
3
-mtime 0 means from time now to 24 hours ago.
-mtime -1 is the same.
list files and dir which changed modification time only in last 24 hours