トップ «前の日記(2023-01-19(Thu)) 最新 次の日記(2023-01-31(Tue))» 編集

屑俺日記

僕の備忘録(PC、UN*X、ネットワーク関連が中心)なんです。
自分の書いたところは適当(な時とか)に書き換えますので御了承を。


2023-01-21(Sat) 時になんとなく

find の mtime

あまり良くわかってなかったので、 いくらか試し。まず、連番のファイル名に 日付をつけてみた。

$ for x in `seq 20`;\
>$gt;  do touch ${x}.txt 
>>     -d 202301`printf "%02d" $x` 00:00:00
>>  done
$ ls -l *.txt | sed -n '4,7p'
-rw-r--r-- 1 user group 0  1月 12 00:00 12.txt
-rw-r--r-- 1 user group 0  1月 13 00:00 13.txt
-rw-r--r-- 1 user group 0  1月 14 00:00 14.txt
-rw-r--r-- 1 user group 0  1月 15 00:00 15.txt

で、find.

$ find . -maxdepth 1 -type f -name '*.txt' -mtime +4 -and -mtime -7
./15.txt
./16.txt

眠いのでここまで。


リンクはご自由にどうぞ。でもURLや内容が変った場合はあしからず。

index.htmlは ここから。