How to find the Magento 2 backend's base URL using the command line?

You can find the backend's URL suffix with grep:

grep "frontName" app/etc/env.php
(
	o=(
		--default-character-set=utf8
		--host=<host>
		--password=<password>
		--user=<user>
		-D <database>
		-e "SELECT path, value FROM core_config_data WHERE path LIKE 'admin/url/%'"		
	) 
	mysql "${o[@]}"
)

The full Magento 2 backend's base URL is <frontend base URL>/<backend suffix>.

If you are uncomfortable with the command line, then you can find the backend's suffix using GUI.

See also: