tab Command

Purpose

Changes spaces into tabs.

Syntax

tab [ -e ] [ File ... ]

Description

The tab command reads the file specified by the File parameter or standard input, and replaces spaces in the input with tab characters wherever the tab command can eliminate one or more spaces. If you specify a file with the File parameter, the tab command writes the resulting file back to the original file. If the input is standard input, the tab command writes to standard output. The tab command assumes that tab stops are set every eight columns, starting with column nine. The file name specified for the File parameter cannot exceed PATH_MAX-9 bytes in length.

Flag

Item Description
-e Replaces only those spaces at the beginning of a line up to the first non-space character.

Example

To replace space characters in the File file with tab characters, enter:

tab File

File

Item Description
/usr/bin/tab Contains the tab command.