shell

Remove Output Containing 'No Such File or Directory'

A memo on how to remove output containing the string 'No such file or directory' using the 'fgrep -v' command in Bash on the Linux command line. I tried to do it with regular expressions, but this gave an error <code>grep conflicting matchers specified</code>...

Shou Arisaka
1 min read
Oct 1, 2025

A memo on how to remove output containing the string “No such file or directory” using the “fgrep -v” command in Bash on the Linux command line.

find . -type f | xargs grep "PIX-DT300" |& fgrep -v "そのようなファイルやディレクトリはありません" |& fgrep -v "No such file or directory"

Like this. Supports both English and Japanese.

find . -type f | xargs grep "PIX-DT300" |& fgrep -v -E '(No such file or directory|そのようなファイルやディレクトリはありません)'

I tried to do it with regular expressions, but this gave a grep: conflicting matchers specified error and didn’t work, so I think the best way is to chain |& multiple times.

Share this article

Shou Arisaka Oct 1, 2025

🔗 Copy Links