manページから:
-P pattern
List only those files that match the wild-card pattern. Note:
you must use the -a option to also consider those files begin‐
ning with a dot `.' for matching. Valid wildcard operators are
`*' (any zero or more characters), `?' (any single character),
`[...]' (any single character listed between brackets (optional
- (dash) for character range may be used: ex: [A-Z]), and
`[^...]' (any single character not listed in brackets) and `|'
separates alternate patterns.
あなたのコマンドtree -P '_tree_file_'
の出力は正確に "_tree_file_" と一致する名前のファイルになります。
あなたはあなたの要求のためのワイルドカードを使用しようとする場合があります。
$ tree -P '*_tree_file_*'
を明確にしてください:あなたは、名前 '_test_file_'が含まれている(その場合には、' find'を使用)のファイルにしたいですか?または内容に '_test_file_'という文字が含まれているファイルを探したいでしょうか(その場合は' grep -r'を使います)? – John1024
上記を編集しましたか?findを使用するのが最適です –