TABS(1POSIX)
β¨ tabs β set terminal tabs β¨
okay bestie, gather round π this is the POSIX Programmer's Manual page for tabs, and we're gonna go through it together, no skimming, no skipping, because every single line here is load-bearing, fr fr.
π PROLOG π
So like, real talk first π«Ά β this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so if you're on Linux, go peek at the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface might not even be implemented on Linux at all. π Not me warning you upfront. That's just being a good friend.
πΈ NAME πΈ
tabs β set terminal tabs
Like, that's the whole vibe. It sets your tab stops. Iconic.
π¦ SYNOPSIS π¦
tabs [-n|-a|-a2|-c|-c2|-c3|-f|-p|-s|-u] [-T type]
tabs [-T type] n[[sep[+]n]...]
Two whole forms, bestie. Pick your fighter. π
π DESCRIPTION π
So what does tabs actually do? It shall display a series of characters that first clears the hardware terminal tab settings and then initializes the tab stops at the specified positions and optionally adjusts the margin. Slay.
Now, the phrase ``tab-stop position N'' shall be taken to mean that, from the start of a line of output, tabbing to position N shall cause the next character output to be in the (N+1)th column position on that line. Got it? Position N β next char lands in column N+1. That's the math, periodt. β¨
The maximum number of tab stops allowed is terminal-dependent. So like, your terminal sets the limit, not us. π«Ά
β οΈ It need not be possible to implementtabson certain terminals. If the terminal type obtained from theTERMenvironment variable or the-Toption represents such a terminal, an appropriate diagnostic message shall be written to standard error andtabsshall exit with a status greater than zero. So yeah β not every terminal is gonna cooperate, and that's a real exit code >0 situation. π
π OPTIONS π
okay so first thing: the tabs utility shall conform to the Base Definitions volume of POSIX.1β2017, Section 12.2, Utility Syntax Guidelines, except for various extensions β specifically the options -a2, -c2, and -c3 are multi-character. They're built different. π
The following options shall be supported:
-nβ Specify repetitive tab stops separated by a uniform number of column positions, n, where n is a single-digit decimal number. The default usage oftabswith no arguments shall be equivalent totabs -8. When-0is used, the tab stops shall be cleared and no new ones set.-aβ1,10,16,36,72β Assembler, applicable to some mainframes.-a2β1,10,16,40,72β Assembler, applicable to some mainframes.-cβ1,8,12,16,20,55β COBOL, normal format.-c2β1,6,10,14,49β COBOL, compact format (columns 1 to 6 omitted).-c3β1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67β COBOL compact format (columns 1 to 6 omitted), with more tabs than-c2.-fβ1,7,11,15,19,23β FORTRAN-pβ1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61β PL/1-sβ1,10,55β SNOBOL-uβ1,12,20,44β Assembler, applicable to some mainframes.-Ttype β Indicate the type of terminal. If this option is not supplied and theTERMvariable is unset or null, an unspecified default terminal type shall be used. The setting of type shall take precedence over the value inTERM.
π‘ lowkey the -c3 list is so long and it ate, honestly. Look at all those numbers. π
π§ OPERANDS π§
The following operand shall be supported:
n[[sep[+]n]...]β A single command line argument that consists of one or more tab-stop values (n) separated by a separator character (sep) which is either a<comma>or a<blank>character. The application shall ensure that the tab-stop values are positive decimal integers in strictly ascending order. If any tab-stop value (except the first one) is preceded by a<plus-sign>, it is taken as an increment to be added to the previous value. For example, the tab lists1,10,20,30and"110+10+10"are considered to be identical.
π«Ά bestie the strictly-ascending thing is not a suggestion, it's a shall. Positive decimals, going up, no exceptions. π
π STDIN π
Not used.
(It's giving "I don't read your messages" energy but in a chill way. π)
π INPUT FILES π
None.
π ENVIRONMENT VARIABLES π
The following environment variables shall affect the execution of tabs:
LANGβ Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1β2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)LC_ALLβ If set to a non-empty string value, override the values of all the other internationalization variables.LC_CTYPEβ Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).LC_MESSAGESβ Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.NLSPATHβ Determine the location of message catalogs for the processing ofLC_MESSAGES.TERMβ Determine the terminal type. If this variable is unset or null, and if the-Toption is not specified, an unspecified default terminal type shall be used.
β¨ LC_ALL is the main character here ngl, it overrides everybody else when it's set to a non-empty string. π
β ASYNCHRONOUS EVENTS β
Default.
π₯ STDOUT π₯
If standard output is a terminal, the appropriate sequence to clear and set the tab stops may be written to standard output in an unspecified format. If standard output is not a terminal, undefined results occur.
π okay so that last part is a real warning bestie β redirect it to a file and you're in undefined-behavior territory. We do not do that. π
π STDERR π
The standard error shall be used only for diagnostic messages.
π¦ OUTPUT FILES π¦
None.
π EXTENDED DESCRIPTION π
None.
πΈ EXIT STATUS πΈ
The following exit values shall be returned:
0β Successful completion. π>0β An error occurred. π
π§ CONSEQUENCES OF ERRORS π§
Default.
The following sections are informative.
π APPLICATION USAGE π
- This utility makes use of the terminal's hardware tabs and the
sttytabs option. - This utility is not recommended for application use.
Some integrated display units might not have escape sequences to set tab stops, but may be set by internal system calls. On these terminals, tabs works if standard output is directed to the terminal; if output is directed to another file, however, tabs fails.
π«Ά so like, terminal-facing = fine, file-facing = no. Noted.
π EXAMPLES π
None.
π RATIONALE π
okay so this is the "why is it like this" section, and it's actually kinda juicy π
Consideration was given to having the tput utility handle all of the functions described in tabs. However, the separate tabs utility was retained because it seems more intuitive to use a command named tabs than tput with a new option. The tput utility does not support setting or clearing tabs, and no known historical version of tabs supports the capability of setting arbitrary tab stops.
The System V tabs interface is very complex; the version in this volume of POSIX.1β2017 has a reduced feature list, but many of the features omitted were restored as part of the XSI option even though the supported languages and coding styles are primarily historical.
There was considerable sentiment for specifying only a means of resetting the tabs back to a known stateβpresumably the ``standard'' of tabs every eight positions. The following features were omitted:
- Setting tab stops via the first line in a file, using
--file. Since even the SVID has no complete explanation of this feature, it is doubtful that it is in widespread use.
In an early proposal, a -t tablist option was added for consistency with expand; this was later removed when inconsistencies with the historical list of tabs were identified.
Consideration was given to adding a -p option that would output the current tab settings so that they could be saved and then later restored. This was not accepted because querying the tab stops of the terminal is not a capability in historical terminfo or termcap facilities and might not be supported on a wide range of terminals.
π not the-toption getting added and then removed, we love a glow-down. And-pnever made it out of committee. RIP to both. π
π¦ FUTURE DIRECTIONS π¦
None.
β SEE ALSO β
expand, stty, tput, unexpand
The Base Definitions volume of POSIX.1β2017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie!! π this one came to you from IEEE/The Open Group, 2017, under the title TABS(1POSIX) β go set those tab stops, you absolute icon, and remember: strictly ascending, no cap. πβ¨π¦
π¦ where this page comes from
- debian bookworm: manpages-posix 2017a-2 Β· Other
- debian trixie: manpages-posix 2017a-2 Β· Other
- ubuntu jammy: manpages-posix 2017a-2 Β· Other
- ubuntu noble: manpages-posix 2017a-2 Β· Other
- ubuntu resolute: manpages-posix 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms