Beginner · 5 min · practise every command in the built-in terminal

less — Interactive File Viewer

less lets you scroll through large files interactively.

Open a file

less /etc/passwd
less /var/log/syslog

Navigation inside less

KeyAction
Space or Page DownNext page
b or Page UpPrevious page
↑ ↓Scroll one line
gGo to beginning
GGo to end
/textSearch forward
?textSearch backward
nNext search result
NPrevious search result
qQuit

less vs more

more is older and simpler — only scrolls forward. less is better — scroll both ways, search, etc.

Tip

less +G /var/log/syslog    # Open at the end of file
less -N /etc/passwd        # Show line numbers

Practice tasks

  1. Open /etc/passwd with less, scroll around, then press q to quit
  2. Open README.txt with more
  3. Open /etc/passwd with less, jumping straight to the end of the file

Commands in this lesson

Reading Files