force shutdown mac dock code example Example: manually shut down docker mac test -z "$(docker ps -q 2>/dev/null)" && osascript -e 'quit app "Docker"'