findコマンドのctime 1とctime +1の違い

findコマンドのctime 1とctime +1の違い

次のコマンドを実行すると:

find . -name "*.jar" -type f -ctime +1

私は何の結果も得られませんが、以下を実行すると:

find . -name "*.jar" -type f -ctime 1

私は結果を得ます。

ベストアンサー1

これは、ディレクトリ内のすべてのjarファイルの状態が48時間以内に変更されたことを意味します。

上海

findマニュアルページによると、

-ctime n
    File's status was last changed n*24 hours ago.

そして…

When find figures out how many 24-hour periods ago the file was 
last accessed, any fractional part is ignored, so to match -atime +1, 
a file has to have been accessed at least two days ago.

そして他の場所では...

+n for greater than n

これは-ctime +1、ファイルの状態を少なくとも48時間前に変更する必要があることを意味します。

おすすめ記事