How to disable 2 factor authentication on command line? Installed twofactor_email, now Can't login!

Yes, you can disable it if you have shell access.

https://docs.nextcloud.com/server/16/admin_manual/configuration_server/occ_command.html?highlight=occ#two-factor-auth-label