I have 100 folders (called "Folder_1", "Folder_2", "Folder_3", ...) containing several files. From a loop over each folder, I would like to run commands (i.e., display the folder name) depending on conditions (i.e., number of files in the folder is not equal to 20133). Here is my code:
for f in *Folder*/; do cd "$f"; if ["$(find . -type f | wc -l)" -ne 20133]; then echo "$f" && cd ..; fi; done
However, I have these error messages:
-bash: cd: Folder_1/: No such file or directory -bash: [20133: command not found ...