commands
expand — convert tabs to spaces
Convert tabs to spaces using tab stops; -t N uses stops every N columns, -i limits conversion to initial tabs. Other bytes remain as text output. Example assumes a fresh text-streams lab fixture.
Formal Syntax & Structure
linux syntaxlinux
expand [OPTION]... [FILE]...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -t | option | Tab stop spacing |
| -i | option | Initial tabs only |
| FILE | operand | Input file |
Return Value
exit status and output
GNU expand writes text with tabs converted to spaces according to selected tab stops and returns nonzero on errors. Successful output may be identical if no applicable tabs exist.
Working Example
Example Snippetlinux
expand -t 4 tabs.txt