正規表現を使用したコマンドの検索

正規表現を使用したコマンドの検索

私が探しているファイルです。

20200521-285353-rpi3-4497-00-0-13-0-0-0-0-n.jpg
Files with Date in the filename from 2020-01-01 to 2020-09-31

いいえ

20201021-*.*

私の正規表現文字列:

^20200[0-9][0-3][0-9]-[0-2].*

バージョンを探す:find(GNU findutils)4.7.0-git

有効な組み合わせが見つかりません。私の試み:

find . -type f -regextype grep -regex '20200[1-9]-*.*'
find . -type f -regex '^20200[0-9][0-9][0-9]\-[0-2].*'
find . -type f -regextype sed -regex '^20200[0-9][0-9][0-9]\-[0-2].*'

ベストアンサー1

globを使ってシンプルにしてください。

find -type f -name '20200521-*'

おすすめ記事