Compile writevt.c: gcc writevt.c -o writevt
Then send commands by ./writevt /dev/ttyN 'ls -al^M'. ^M means return char, which is obtained by typing ctrl-v ctrl-m.
SeeNames pipes and screen/tmux are also efficient methods, you may see thishere for other methodsdetails.