Question: When I am in `vim` I can change the tab size with the following command:

```
:set ts=4

```

Is it possible to set tab size for `cat` command output too?

Answer: 
The first command here *emulates* the formatting you see in `vim`. It intelligently expands tabs to the equivalent number of spaces, based on a tab-STOP (ts) setting of every 4 columns. 

```
printf "ab\tcd\tde\n" |expand -t4   

```

Output 

```
ab  cd  de

```

To keep the *tabs* as *tabs* and have the tab **STOP** positions set to every 4th column, then you must change the way the environment works with a tab-char (just as vim does with the `:set ts=4` command) 

For example, in the terminal, you can set the tab **STOP** to 4 with this command;

```
tabs 4; printf "ab\tcd\tde\n" 

```

Output 

```
ab  cd  de

```
To expand on the already given answers, `expand` can also take a list of tab stop positions. This is useful if the content lengths of the varlious columns varies a lot.

I came over this requirement today when I wanted to make the output of `openssl ciphers` more readable:

```
$ openssl ciphers -v 'HIGH'|tr -s ' ' '\t'|expand -t31,41,57,70,90
ECDHE-RSA-AES256-GCM-SHA384    TLSv1.2   Kx=ECDH         Au=RSA       Enc=AESGCM(256)     Mac=AEAD
ECDHE-ECDSA-AES256-GCM-SHA384  TLSv1.2   Kx=ECDH         Au=ECDSA     Enc=AESGCM(256)     Mac=AEAD
ECDHE-RSA-AES256-SHA384        TLSv1.2   Kx=ECDH         Au=RSA       Enc=AES(256)        Mac=SHA384
ECDHE-ECDSA-AES256-SHA384      TLSv1.2   Kx=ECDH         Au=ECDSA     Enc=AES(256)        Mac=SHA384
...
ECDH-ECDSA-AES128-SHA          SSLv3     Kx=ECDH/ECDSA   Au=ECDH      Enc=AES(128)        Mac=SHA1
AES128-GCM-SHA256              TLSv1.2   Kx=RSA          Au=RSA       Enc=AESGCM(128)     Mac=AEAD
AES128-SHA256                  TLSv1.2   Kx=RSA          Au=RSA       Enc=AES(128)        Mac=SHA256
AES128-SHA                     SSLv3     Kx=RSA          Au=RSA       Enc=AES(128)        Mac=SHA1

CAMELLIA128-SHA                SSLv3     Kx=RSA          Au=RSA       Enc=Camellia(128)   Mac=SHA1
PSK-AES128-CBC-SHA             SSLv3     Kx=PSK          Au=PSK       Enc=AES(128)        Mac=SHA1

```

Using only `expand -t31` would blow up the width of the output from around 100 characters to more than 160 characters.