2
私はこのようなfindコマンドがあります。このようなfindコマンドでregexをnameに使用するにはどうすればいいですか?
find /root/newdir/ -mindepth 1 -maxdepth 1 -type f
出力:
/root/newdir/test.log
/root/newdir/test2.log
/root/newdir/tmp_test3.log
/root/newdir/test.zip
を私はtest
と終了.log
を開始するファイルを検索する必要があります。時には複雑な正規表現も必要になることがあります。私はこのように私例えば-regex
を試してみたが、動作しません:
find /root/newdir/ -mindepth 1 -maxdepth 1 -type f -regex "^test*.log$"
は、どのように私はfindコマンドで^ $
文字のような正規表現を使用することができますか?