Is there a direct way to find out if the bootloader on a new unrooted device is currently locked or not? I would like to do this without the risk of clearing or bricking the device. I am looking for some command in adb or fastboot that will just provide this information.

The reason I ask this, is because all my rooting attempts have failed so far. I suspect a locked bootloader.