タイトルそのままlinuxコマンドで
問題
wc -l /var/tmp/20191126-(2,135,397個)テストファイル.csv
のように「20191126-(2,135,397個)ファイル.csv」ファイルの行数を取得しようとしたらエラー
-bash: syntax error near unexpected token `('
シンタックスエラーだと。。。
解決策
どうやら「(」が特殊文字でエスケープする必要があるとのこと
ファイル名をシングルクォートで囲めばOK!
wc -l '/var/tmp/20191126-(2,135,397個)テストファイル.csv'
PHPであれば、、
$filePath = '/var/tmp/20191126-(2,135,397個)テストファイル.csv'
$totalRows = exec("wc -l '${filePath}'");
これで正常にできるはず
かんたん