I was looking for a command that can behave the same way as we type and send the commands from the box in the serial monitor. Just because I am using hardware serial for ESP32 (UART 1) I don't know how we can send command same way we do on UART 0 with serial monitor as stated above. I tried using "UART1.write(command)" but the module connected on UART1 didn't received any command. can anyone tell me correct way of sending commands on the UART?
You need a TTL to USB connector to connect UART1 to the computer and then open the IDE monitor on that new COM port. See this project for a suitable TTL to USB cable.
Remember to connect TX - RX and RX - TX and to connect the GND cable.