title: How do I know which serial port to use on Linux?
body: <p>I'm going to be writing a program in C which is going to open a connection over serial port, and "listen" for incoming commands, then it will take some action and report back a status.</p>
  
  <p>The connection is going to be over RS232 (Serial port) and I'm trying to understand how to know which port to open. </p>
  
  <p>When using windows, if I hook up my usb-serial device I see "Prolific USB-to-Serial Comm Port (COM4)" show up in the device manager... but on the Linux side I don't see any changes in the <code>/sys/class/tty</code> or <code>/dev</code> area, I see <code>ttyS0</code> through <code>ttyS7</code> present all the time (I'm assuming the <code>S</code> stands for serial based on <a href="http://www.easysw.com/~mike/serial/serial.html" rel="nofollow noreferrer">what I've read</a>). </p>
  
  <p>So how do I know which one to connect to?</p>
  
  <p><strong>EDIT</strong><br>
  While I'm <strong>developing</strong> this on a OpenSUSE 12.1 box (3.1 kernel), the final program will be run on uCLinux on a board running a 2.4Linux kernel, so I'm looking for pure C solutions which will work on older kernels</p>
  
  <p>FYI: the <code>/sys</code> file system as noted in the answer to <a href="https://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them">this post</a> didn't exist until the 2.6 kernel and my constraints force me to stick to things available in the 2.4 kernel.</p>