ファイルの作成
touch a1.txt a2.txt a3.txt
touch s1.mp3 s2.mp3 s3.mp3
だから私はやる
find . -name "*.txt" -or -type f -print
そして、なぜファイルs1.mp3
s2.mp3
s3.mp3
が表示されないのですか?.txt
ベストアンサー1
演算子の優先順位のため:絶対的なAND間のAND()は-a
OR()よりも優先順位が高くなります。-type f
-print
-o
find . \( -name "*.txt" \) -or \( -type f -print \)
欲しいかもしれないけど
find . \( -name "*.txt" -or -type f \) -print
すべてのファイルを印刷します。