For a quick check I do not want to create a plugin or a test page.
wp eval 'echo get_option( "blogname" ), PHP_EOL;'
wp eval-file check.php
wp eval loads WordPress and then executes the PHP you give it, so every core function and loaded plugin is available. Use single quotes around the code in the shell and double quotes inside it. wp eval-file does the same for a file, and extra arguments reach it in $args. The code runs with full rights and without a user, so it can change or delete data. Run it on a copy first and take a database export before anything that writes.
Further reading: WP-CLI: wp eval