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.
サーバーに探しているファイル名があるかどうかを確認しています。テキスト ファイルにファイル名のリストがあり、これらのファイルがサーバーに存在するかどうかを確認したいと考えています。PythonまたはLinux bashシェルツールでそれを行う方法はありますか
ファイルが名前を 1 行に 1 つずつ保持していると仮定すると、次のように動作するはずです。
find / -type f | grep -f **filenames**
マシンの速度が遅い場合やファイルが多い場合は、完了するまでに時間がかかることがあります。
ロケート (updatedb) が利用可能/稼働中の場合は、次の処理が速くなる可能性があります。
locate -r . | grep -f **filenames**