FYI, I managed to try this command on several different models of Apple laptops with varying results. It seems many laptops don't access to the temps or SMC attributes. The laptops I've been able to retrieve the SMC values have been the USB-C 2016+ models. On some older laptops it is telling me it cannot retrieve SMC values because "SMC is currently in monitor mode". I'm not sure what is going on with that error message. If you use this part of the command without adding the "grep" filter, then you will see the information provided and any error messages:
sudo powermetrics -n1 --samplers smc
The command provided by @VikingOSX is incorrect as it cannot parse the "(CPU|GPU)" portion of the filter. The following updated command will work if the SMC values are accessible (notice the inclusion of the "-E" option necessary for the "(CPU|GPU)" portion of the filter to work -- tested on Big Sur):
sudo powermetrics -n1 --samplers smc | grep -iE "(CPU|GPU) die"
Of course this all assumes you are using an Intel Mac since M1/M2 Macs with Apple Silicon do not have an SMC so these command will not work at all. I have no idea how to access any sensor information on Apple Silicon Macs or possible alternate methods on the Intel Macs. I normally just rely on third party apps like MacsFanControl to provide the functionality, although I may be looking into an app which can produce a sensor log over time (I don't usually need this functionality, but there are times it may prove useful).