I want to quickly identify files of this form (shape of the "matrix" can change)
0,0,0,0,0
0,0,0,0,0
0,0,0,0,0
0,0,0,0,0
What is the simplest way of doing it?
>Solution :
Try to match any character other than 0 or , with [^0,]. If that fails, the file only contains zeroes.
if ! grep -q '[^0,]' filename.csv
then
echo file is all zeroes
fi