3

I'm using TAB for display a block of code with commnad:

echo -e "192.168.1.103 \t TUNG \t 30:65:ec:1f:77:b7"
echo -e "192.168.1.107 \t LCT3VCLJN2K3MCZ \t 00:1f:c6:53:a5:36"

but it display not correctly in terminal:

But I want it to be display bellow:

I'm using Ubuntu 14.04, please help me !

Thanks in advance !

1
  • 2
    You need 2 tabs in the 1st line. The middle text is touching the same distance as the next tab.
    – Rinzwind
    Dec 24, 2014 at 10:17

1 Answer 1

4

Use the column command:

$ { echo 192.168.1.103 TUNG 30:65:ec:1f:77:b7; echo 192.168.1.107 LCT3VCLJN2K3MCZ 00:1f:c6:53:a5:36;} | column -t
192.168.1.103  TUNG             30:65:ec:1f:77:b7
192.168.1.107  LCT3VCLJN2K3MCZ  00:1f:c6:53:a5:36
3
  • is this command available on other distros ?
    – Alex Jones
    Dec 24, 2014 at 10:30
  • @edwardtorvalds Column is a fairly standard command, yes.
    – muru
    Dec 24, 2014 at 10:30
  • @TonyTran you can mark the answer as accepted by clicking icon under vote arrows.
    – andrybak
    Dec 24, 2014 at 14:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .