Tab character width in Terminal

19,597

To set your tab with to 2 spaces, use this command in the Terminal App:

tabs -2

Replace 2 with your desired width in spaces.

View the full manual for tabs to learn about all options.

Share:
19,597

Related videos on Youtube

NVI
Author by

NVI

Updated on September 17, 2022

Comments

  • NVI
    NVI over 1 year

    Default tab width for Mac OS X Terminal.app is 8. I want to change it to 2. How can I do it?

    I've found tabs command, but I can't figure out how to use it.

  • Tobia
    Tobia almost 10 years
    I can't get tabs command to work properly. If I try echo $'12345678|\n\t|' on a new Terminal, I can see the default 8 tab width working correctly. But if I try tabs -4; echo $'1234|\n\t|' I get misaligned pipe symbols. Is this a bug in Terminal?
  • Victor Gavro
    Victor Gavro almost 10 years
    Works as expected for me with correct alignment. What is your terminal windows size, what version of OSX are you on and what font (and font size) are you using ?