Exploring less and more - Linux Commands

| 5 min read

What are the more and less Commands in Linux?

The more and less commands are used to view the contents of text files in a paginated manner. These commands are particularly useful for reading through large files without loading the entire content into memory at once.

Basic Syntax:

By default, both commands will display the contents of the file one screen at a time.

more:

more [option] [file]

less:

less [option] [file]

Options

  • Options for more
OptionDescription
-dPrompt with “[Press space to continue, ‘q’ to quit.]” and display “[Press ‘h’ for instructions.]” instead of ringing the bell
-cClear the screen before displaying the next page
-sSqueeze multiple blank lines into one
-uSuppress underlining
  • Options for less
OptionDescription
-NShow line numbers
-SChop long lines instead of wrapping
-XDisable termcap init/deinit codes
-FAutomatically exit if the entire file fits on one screen

Additional Help

You can explore more by using the commands:

# more
more --help
# or
man more

# less
less --help
# or
man less

Thank you!

Thank you for your time and for reading this!