Hot answers tagged command-line
less works with screens of text. The "screen" is the full size of the terminal. less --window=n can tell less to only use so many rows at a time. That being said the option is not always available. see man less If you only want "some" output try tail -n 20 /file.txt for the last 20 lines, or I personally use head -n 20 | tail -n 10 to get the middle 10 ...
Sure, just use read: while read -r line; do command "$line" done < file In your more specific screen example, you need to remove the remaining text: while read -r session _; do screen -S "$session" test -X done < file
from less manual, to scroll n lines at a time, but shows a whole screen-full. -[z]n or --window=n Changes the default scrolling window size to n lines. The default is one screenful. The z and w commands can also be used to change the window size. The "z" may be omitted for compatibility with some versions of more. If the number n is negative, it ...
Only top voted, non community-wiki answers of a minimum length are eligible