Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、多くのファイル (f1.dat、f2.dat ...、f100.dat など) を含むディレクトリがあります。そして、どのファイルに文字列が含まれているかを調べたい(文字列「エラー」と言う)。どうやってするの。
できるよ:
grep -l "your_string" /your/dir/f*.dat
-l
f*.dat
f[something].dat
ディレクトリ内のすべてのファイルからチェックしたい場合は、これが役立ちます。
grep -l "your_string" /your/dir/