Linux expand command: converts tabs in files to spaces for writing to standard output
Linux expand command Function Description
Use the expand command to convert the tabs in each file to spaces to write to the standard output.
If no file is specified, or if the file is -
, the program will read the data from the standard input.
Linux expand command Syntax
expand [Option] [File]
The meaning of each option in the command is shown in the table:
Option | Description |
---|---|
-i | Tabs after non-whitespace characters are not converted |
-t<Digital> |
Set each tab to the width of the specified number, instead of the default 8 |
-t<List> |
Specify a list of tab positions, separated by commas |
Linux expand command Demo
Convert tabs to spaces in the /root/apidemos.com.txt file
[root@rhel ~]# expand /root/apidemos.com.txt
Output: