Command Line Basics: View Text With less

April 21, 2010 by
Filed under: command line, HowTo, linux 

I've shown previously how to use the more command to view text output. Today I'll show how to do the same thing with the less command. You can run the command simply by opening a  terminal window and entering less followed by the file name. For example: 

less /proc/meminfo

What's nice about the less command is that there are many ways to navigate the file. For example, the scroll wheel on your mouse can be used to scroll up and down through the file. The space bar will advance the file by one screen full. You can also use the Page Up and Page Down keys. When you're done viewing the file, use the [Q] key to quit.

As with many terminal commands, you can redirect output to the less command using a pipe.

ls -l /etc | less

To learn more about the less command, check the info page.

Affiliate Link
info less

Comments

2 Responses to “Command Line Basics: View Text With less”

  1. Story added...

    This story has been submitted to fsdaily.com! If you think this story should be read by the free software community, come vote it up and discuss it here:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>