How do I convert tabs in files to spaces on linux?



  • Also see: Man page for expand.

    Test file. The tabs in between the letters are 8 characters apart by default.

    $ cat testfile
    a       b       c       d
    

    Convert tabs in a file to spaces. The -t number determines the number of spaces to use.

    $ expand -t1 testfile
    a b c d
    


© Lightnetics 2024