How to find all Sun Sat on command line
The macOS/BSD version of date can't read from standard input so you need to loop manually.
for d in $(seq -f %1.0f 20210101 20211231); do 
    date -jf &quot;%Y%m%d&quot; $d 2&gt;/dev/null | grep 'Sat\|Sun'
done

You can avoid most of the impossible dates created by seq (and get the result faster) by running
for m in {01..12}; do
    for d in {01..31}; do
        date -jf &quot;%Y%m%d&quot; &quot;2021${m}${d}&quot; 2&gt;/dev/null
    done
done | grep 'Sat\|Sun'