I need to check all the L3 switches if they are configured with same ospf ID, As i am doing it in the Cisco prime, there are routers in the inventory too. Is there a show command where i can clearly distinguish between a router and a switch.
I'd suggest using
show inventory since that will show Model (also known as PID), version (hardware revision) ID, along with the serial number. For a switch it would show something like
PID: WS-C3850-48T-E, VID: V02, SN: FOC1234567 so you know right away that it's a switch, model Catalyst 3850 48-port.