I have a directory with a few dozens of files. I would like to do something with every second file from this directory. By now I only used find command but with thi
cnt=0;
for file in $(find ./dir -type f); <-- if not too many matches
do
let cnt=cnt+1;
if [ $cnt -eq 2 ];
then echo $file; <-- do something
cnt=0; <-- alternate file
fi;
done