LinuxCommandLibrary

tabs

Set terminal tab stops

SYNOPSIS

tabs [options] [tabstop...] or tabs [-T term]

PARAMETERS

-T term
    Specifies the terminal type. If not specified, the TERM environment variable is used.

-d [distance]
    Sets tab stops at regular intervals of [distance] columns. Default distance is 8.

-n
    Treats each argument as a single tab stop.

-a
    Assembler format tabs: 1, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74

-i
    Fortran format tabs: 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75

-l
    Sets left margin to column 1 and cancels any existing tab settings

-t list
    Sets tab stops at the column positions specified in the 'list'. Column positions must be comma separated and in ascending order.

+m [number]
    Adds a number of columns to each specified tab stop.

-s
    Sets tabs, clearing terminal tab settings. This is not always supported.

-help
    Display help text and exit.

-version
    Display version information and exit.

DESCRIPTION

The `tabs` command is used to set the tab stops on a terminal. It allows users to control how text is aligned and formatted when tabs are encountered in the output. This command is particularly useful for displaying text-based tables or aligning data in a predictable manner. Without options `tabs` clears all defined tab stops. Tab stops can be set at fixed intervals or at specific column positions. The configuration of tab stops affects how the terminal interprets the tab character (\t) and influences the overall layout of displayed text. This command provides simple means for text formating.

CAVEATS

The behavior of `tabs` can be terminal-dependent. Some modern terminal emulators may not fully support or accurately emulate the tab stop settings configured by this command. Using `tabs` might not have the desired effect in all environments.

EXAMPLES

Set tab stops every 8 columns:
tabs -8

Set tab stops at specific columns (5, 10, 15):
tabs 5,10,15

Clear all defined tab stops:
tabs

HISTORY

The `tabs` command has been a part of Unix-like operating systems for a long time. Its primary purpose was to provide a standardized way to set tab stops on terminals, ensuring consistent output formatting across different environments. In older teletype environments the use of the tab character was critical to producing consistent output. Early versions were crucial for aligning columns of data on physical teletype printers and early video terminals. Today, its usage is less frequent because many modern terminal emulators offer more flexible formatting options, but it remains a useful tool for specific formatting tasks and backward compatibility.

SEE ALSO

expand(1), unexpand(1)

Copied to clipboard