Couple of methods to get route name by using path

To get route name that you maybe want to use in some custom code you can get it with this 2 ways

$url = 'admin/commerce/config/shipping-methods';

\Drupal::request()->get(Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_NAME);
$object =\Drupal::service('path.validator')->getUrlIfValid($url);

ksm($object);

and you will have and URL object with info you can utilize. Other way is similar and output is an array

$url = 'admin/commerce/config/shipping-methods';

$request = \Symfony\Component\HttpFoundation\Request::create($url);
$router = \Drupal::service('router.no_access_checks');
$match = $router->matchRequest($request);

ksm($match);