6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

指定したディレクトリ配下で10分以内に更新されたファイルを一覧する

Last updated at Posted at 2016-04-21

Jekyll で生成してる Web サイトのキャッシュクリアのために10分以内に更新されたファイルの一覧が必要になったのでそのコマンドをメモっとく。

find でディレクトリを指定して、mmin オプションで -10 を指定する。mmin は modified minutes の意味のようだ。オプションに指定する値が、10 なら10分前に更新されたファイルで、-10 なら10分前〜現在に更新されたファイルで、+10 なら過去〜10分前に更新されたファイルというように意味が異なる。

$ find _site -mmin -10

ちなみに下記のようなコマンドで CDN のキャッシュクリアに必要な URL を取得した。

$ find _site -mmin -10 | sed "s#_site#http://example.com#"

参考文献

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?