inIn my main_dirmain_dir, I have a lot of sub-folders say DFT1-> DFT150DFT1 to DFT150, and in each directory, there is a file named OSZICAR..OSZICAR. However, some of this would have file size 0..
So I would like to have a script, that goes into each folder and checks the size of OSZICAROSZICAR, if it is below size of 10 bytes... Then, then delete its DFTDFT folder...
The pseudo-code (which doesn't work), I have is:
for f in *; do
cd $f
status=(check whether OZICAR has size below 10bytes)
cd ..
if (status); do
rm -r $f
fi
done
Could anyone help? Thank you