Written 31 Aug 2026. This is a how-to, not a product card.
See terminal columns and colors
After reset, tput cols prints window width in columns. An optional tput colors peek shows color support.
Fix a garbled terminal restored terminal settings with reset. Tonight you ask for terminal columns (and colors): tput. Tput means terminal capability query. tput cols prints window width in columns. One column is one character wide. Example 80 is 80 columns wide.
Color support is tput colors (optional peek, not tonight's job). Type tput cols. You want a number. You are still only practicing in home on the computer. It does not need extra system software, htop, Grafana, or a NAS for this one job.
Skip until SSH already works
SSH from the couch should already get you a prompt. SSH means type commands from your laptop, on the house network. If a garbled terminal fix is what you want, that is fix a garbled terminal. Skip reset as tonight's job. Skip tput reset too. That peek lives on reset. If window size is what you want (rows and columns), that is see window size. Skip stty size as tonight's job.
What this is
tput cols means window width in columns. The command is tput cols. Tput means terminal capability query. One column is one character wide. Example 80 is 80 columns wide.
After reset, this is terminal columns so window width and color support make sense. You don't need extra system software for this.
Practice tput in home
SSH in. Make sure home is where you sit:
pwd
You want a path that ends in your login name. If not:
cd ~
Ask window width:
tput cols
You want a number. That number is window width in columns. Example 80 is 80 columns wide. Tput cols means window width. That is enough for tonight. Practice only in home.
Debian and Ubuntu already have tput (ncurses-bin, usual install). Don't make apt the job.
If tput is missing, optional aside:
sudo apt install ncurses-bin
Then stop. That apt line is not the lesson.
No files are required for this practice. If you made practice files anyway, throw them away with careful delete only. That is delete a file carefully. Skip rm -rf.
Useful extras, still home only
Optional extra: tput lines if present (peek rows):
tput lines
That peek is window rows, not window width. You can stop at tput cols. Don't make tput lines the job.
Optional extra: tput colors if present (peek color support):
tput colors
That peek is the color count the terminal claims. Example 8, 16, or 256. You don't paint the screen tonight. You only ask the number. You can stop at tput cols.
Optional extra: tput clear if present:
tput clear
That line is a window wipe, not window width. That is clear the window. Don't make tput clear the job.
Skip tput reset as tonight's job. That peek lives on reset. Skip stty raw, stty -echo, and stty sane as practice. Don't break the terminal on purpose. Tonight: tput cols.
Skip screen, tmux, htop, Grafana, and a NAS. Skip files under /etc and /dev as a dump. Practice only in home. Keep SSH on the house network: keep the computer on the house network. Don't forward port 22.
What this is not
This is not reset. Reset restores terminal settings, not window width. That is fix a garbled terminal. It is not stty size. Stty prints window size (rows then columns). That is see window size. It is not clear. Clear wipes the window. That is clear the window.
What next
Need garbled terminal fix? Fix a garbled terminal. Need a number list? Print a number list. Keep SSH on the house network: keep the computer on the house network. Don't forward port 22.
Skip
- Skip if SSH still fails. Finish SSH from the couch first.
- Skip
resetas tonight's job. Reset restores terminal settings: fix a garbled terminal. - Skip
stty sizeas tonight's job. Stty prints window size: see window size. - Skip
clearandtput clearas tonight's job. Tonight:tput cols. - Skip
stty rawandstty -echoas practice. Don't break the terminal on purpose. - Skip
screen,tmux, htop, Grafana, and a NAS. - Skip files under
/etcand/devas a dump. Practice only in home. - Skip
rm -rf. Careful delete only: delete a file carefully. - Skip opening SSH to the internet. That is keep the computer on the house network. Don't forward port 22.
Sources
Debian: tput(1). Ubuntu: tput(1). Official pages only. For a garbled terminal fix, see fix a garbled terminal. For window size, see see window size. For a window wipe, see clear the window. For the terminal name, see see the terminal name. For the login, see SSH from the couch.