Convert tabs to spaces

To convert tabs in a text file to spaces, you can use the expand command. To convert each tab to a single space character, use the -t 1 option.

Here is an example file:

linux example file for the expand command

In the picture above you can see that every word in the file is separated by tabs. To convert these tabs to spaces, we can use the following command:

linux expand command

Geek University 2022