All devices on Unix are mapped to a device file, the serial ports would be
/dev/ttyS1 ... .
First have a look at the permissions on that file, lets assume you are using
ls -l /dev/ttyS1
You will want read.write access, if this is a shared system then you should consider the security consequences of opening it up for everyone.
chmod o+rw /dev/ttyS1
A very simple crude method to write to the file, would use the simple
echo -ne '\033[2J' > /dev/ttyS1
and to read
cat -v < /dev/ttyS1
You can have cat running in one terminal, and echo in a 2nd.
If everything is gibberish, then baud rate, bit settings might need setting before you start sending.
stty will do that. !! NOTE stty will use stdin as default file descriptor to affect.
stty -speed 19200 < /dev/ttyS1
stty -speed 19200 -f /dev/ttyS1
This might be enough for you to script something and log ? Not sure what you are trying to achieve.
For a more interactive, remembers your default settings approach would be to use
minicom it is just a program which does everything I've mentioned so far. (similar to hyperterminal in Windows, you might be familiar).
An intermediate solution, would use a terminal program like
screen which will work on a serial device.
man stty for more information