I'm writing a script which shows the git log for a directory when I cd into it.
Such a log can be overwhelming, containing hundreds of lines. So far I have been limiting that to a hard-coded 30 lines with (... | head -n 30), cool on the big screen at Work, too big at home. I would prefer the log to take up about half the (vertical) screen on any terminal, e.g. Gnome at work, iTerm2 at home. I do not use screen or tmux. But would like to learn them.
How do I find the number of vertical lines available in a terminal from command line?