0
0
Linux CLIscripting~5 mins

less and more (paginated viewing) in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main purpose of the less command in Linux?
The less command lets you view text files one screen at a time. It allows you to scroll forward and backward through the file easily.
Click to reveal answer
beginner
How does more differ from less in terms of navigation?
more only allows forward navigation through a file, while less lets you move both forward and backward.
Click to reveal answer
beginner
Which key do you press to quit less or more?
Press the q key to quit and exit the less or more viewer.
Click to reveal answer
intermediate
How can you search for a word inside a file when using less?
Type / followed by the word you want to find, then press Enter. Use n to go to the next match.
Click to reveal answer
intermediate
What happens if you run cat filename | less?
It sends the output of cat filename into less, letting you view the file page by page instead of all at once.
Click to reveal answer
Which command allows backward scrolling through a file?
Acat
Bless
Cmore
Dhead
What key do you press to exit more or less?
Ae
Bx
Cq
DCtrl+C
How do you search for a word inside less?
AType #word
BType :search word
CType ?word and press Enter
DType /word and press Enter
Which command only allows forward scrolling?
Amore
Bhead
Ctail
Dless
What does cat file | less do?
ASends file content to less for paginated viewing
BDisplays the file all at once
CEdits the file
DDeletes the file
Explain how you would use less to view a long log file and search for a specific error message.
Think about opening, searching, navigating, and exiting.
You got /4 concepts.
    Describe the differences between less and more commands and when you might prefer one over the other.
    Focus on navigation and features.
    You got /4 concepts.