variable

LINES

Number of terminal rows. Bash can update this from terminal dimensions when checkwinsize is enabled. Assigning the variable does not resize the actual terminal. The PTY fixture supplies a 28-row, 90-column window. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Use interactive Bash with default key bindings; expected visible result: 28.

Formal Syntax & Structure

bash syntaxbash
LINES

Return Value

shell variable

Expansion yields the current value in its applicable context, not a separate command exit status.

Working Example

Example Snippetbash
# In fresh interactive Bash in a 28x90 terminal:shopt -s checkwinsize/usr/bin/trueprintf "%s\n" "$LINES"
Bash Reference