Can I do a find
and list files where ctime and mtime are not equal?
find . -type f -name '*.php' -ctime -5 MISSING_PART
MISSING_PART: something like -mtime != -ctime
Can I do a find
and list files where ctime and mtime are not equal?
find . -type f -name '*.php' -ctime -5 MISSING_PART
MISSING_PART: something like -mtime != -ctime
This can be obtained using
stat
command. Thestat
command is used to display file or file system status. The-c
option is used to specify the format of the output of this command. The%n
format is used to specify the file name. The%Y
is used to specify the time of last modification since epoch and%Z
specifies the time of last change since epoch.The command
find . -exec stat -c %n#%Y#%Z {} \; | awk -F# '{if ($2 != $3) print $1}'
can be used to extract files whose change time and modification time are not equal.The
-ctime n
and-mtime n
options forfind
refer to last changed or modified time sincen
hours ago. This concept of range of time is not captured in this command.