Linux

  1. Home
  2. Computing & Technology
  3. Linux

From Authors, for About.com

given in Table 4-2 . Each of these flags is enabled by supplying it to stty and disabled by supplying it to stty with the – character in front of it. Thus, to disable hardware handshaking on the ttyS0 device, you would use:


   

$ stty -crtscts -F /dev/ttyS0

Table 4-2. stty Flags Most Relevant to Configuring Serial Devices

   
   Flags    Description
   N    

Set the line speed to N bits per second.


   crtsdts    

Enable/Disable hardware handshaking.


   ixon    

Enable/Disable XON/XOFF flow control.


   clocal    

Enable/Disable modem control signals such as DTR/DTS and DCD. This is necessary if you are using a "three wire" serial cable because it does not supply these signals.


   cs5 cs6 cs7 cs8    

Set number of data bits to 5, 6, 7, or 8, respectively.


   parodd    

Enable odd parity. Disabling this flag enables even parity.


   parenb    

Enable parity checking. When this flag is negated, no parity is used.


   cstopb    

Enable use of two stop bits per character. When this flag is negated, one stop bit per character is used.


   echo    

Enable/Disable echoing of received characters back to sender.

The next example combines some of these flags and sets the ttyS0 device to 19,200 bps, 8 data bits, no parity, and hardware handshaking with echo disabled:


   

$ stty 19200 cs8 -parenb crtscts -echo -F /dev/ttyS0


   Prev    Home    Next
   Serial Hardware    Up    Serial Devices and the login: Prompt

Explore Linux

About.com Special Features

Linux

  1. Home
  2. Computing & Technology
  3. Linux
  4. Linux Documentation
  5. Linux Network Admin Guide
  6. Linux Network Administrators Guide - 4.5.2. The stty Command

©2009 About.com, a part of The New York Times Company.

All rights reserved.