termsize - determine terminal (window) size


termsize [ format ... ]


termsize determines the current terminal (window) size and prints the terminal type and the number of lines and columns on the standard output. format specifies the output format in printf(3) style. %c outputs the number of lines, %l outputs the number of columns, %t outputs the terminal name and any other character is output as is. The default format is "TERM=%t LINES=%l COLUMNS=%c".

The terminal (window) size is determined as follows. If the environment variable TERM has the form TERM=s LINES=l COLUMNS=c then s is the terminal type, l is the number of lines and c is the number of columns, otherwise the lines and columns are determined by winsize(3). The default values are taken from termcap(5) if the TERM environment variable is defined and are otherwise LINES=24 and COLUMNS=80.


winsize(3), termcap(5)

November 07, 2006