tput - How Big is it?
Post date: 09-Mar-2012 16:09:26
It's not every day you learn a new Unix command especially and old command that is useful in today's wobbly window world.
tput queries the terminal database to find out how big your terminal is. But this depends on your window these days. Gone are the days of an 80x24 terminal. Sometimes though you need to know, "How big is it?"
To find out how many columns you have:
tput cols
To find out how many rows/lines you have:
tput lines
That's it!
Here I was changing the terminal size and it dynamically updates: