Skip to content

Turn tabs into spaces on Linux and vice versa

The Linux expand and unexpand commands sound like they can make files larger and smaller, but what they actually do is turn tabs into spaces and spaces into tabs.

In this post, we’ll use some simple text files to demonstrate what happens when you use expand and unexpand. We’ll also compare how these commands work with some likely more familiar commands—sed and awk—that can provide similar results and offer additional options.

[Get regularly scheduled insights by signing up for Network World newsletters.]

To begin, let’s take a look at this very simple text file:

To read this article in full, please click here

Source:: Network World – Linux