Connecting via serial with Arduino comand line
If you are using linux, as I guess, you can look at this archwiki page. Even if is a wiki relative to archlinux OS some informations explained are LinuxOS independendent.

For your needs, you can use screen command. Here is an example: remember to substitute the serial port with the one wich arduino is connected (usually /dev/ttyACM* or /dev/ttyUSB*) and to specify the right baud rate.

screen /dev/ttyACM0 9600