On Unix-like operating systems, the tabs command sets tab stops on a terminal.

This page covers the Linux version of tabs.

Description

The tabs program clears and sets tab stops on the terminal. This uses the clear_all_tabs and set_tab capabilities of the terminfo database. If either is absent, tabs cannot clear or set tab stops. The terminal should be configured to use hard tabs, for example with the following stty command:

  • Description
  • Syntax
  • Explicit tab stop lists
  • Pre-defined tab stop lists
  • Examples
  • Related commands
  • Linux commands help

stty tab0

Syntax

tabs [-n | –file [[-code] | -a | -a2 | -c | -c2 | -c3 | -f | -p | -s | -u]] [+m [n]] [-T type]

Options

The tabs program processes a single list of tab stops. The last option to be processed which defines a list is the one that determines the list to be processed.

Explicit tab stop lists

An explicit list can be defined after the options (this does not use a “-”). The values in the list must be in increasing numeric order, and greater than zero. They are separated by a comma or a blank, for example,

tabs 1,6,11,16,21

tabs 1 6 11 16 21

Use a ‘+’ to treat a number as an increment relative to the previous value, e.g.,

tabs 1,+5,+5,+5,+5

…which is equivalent to the 1,6,11,16,21 example.

Pre-defined tab stop lists

The X/Open standard defines several pre-defined lists of tab stops for certain coding styles, which can be set using the following -code options:

Examples

tabs -c

Set the terminal’s tab stops for normal COBOL formatting.

tabs -d 13,19,29,36,43

Set the tab stops to 13, 19, 29, 36, and 43 spaces, and display a ruler which shows expected and real tab stops.

stty — Set options for your terminal display.