Linux Commands Training Quick Tips – Using Linux Less & More Commands to Pause Output

linux50 Linux Commands Training Quick Tips   Using Linux Less & More Commands to Pause Output
Clyde E. Boom asked:




The more and less commands can be used with the | (verical bar or “pipe” symbol) to pause the output of a Linux command.

Example of Using the Linux more Command

The more command can pause the output of a command, but it doesn’t work as well..

For example, you can’t scroll up in the output of a Linux command with the more command – or search for text in the output of a command.

Run the following command to list the contents of the etc directory, which is off of the / (root) directory – and to see the output “scroll off the top of the screen”.

$ ls -l /etc

Now run the following command example to pause the output of the ls command so that it doesn’t “scroll off the top of the screen”.

Be sure to type in the | (vertical bar) between /etc and more.

$ ls -l /etc | moreLinux Commands Training Tips:

The vertical bar “|” symbol is usually below the Backspace key on your keyboard and is referred to as the “pipe” symbol. It is used to “pipe” the output of one command into another command. In this case, you are “piping” the output of the less command to the more command.

Press the Spacebar a few times to scroll down a “screenful”.

Press the up arrow key and then the Page Up key and see that you can’t scroll up.

Press q to quit out of the Linux more command.

Example of Using the Linux less Command

Now run the less command example below to pause the output of the ls command.

Make sure you type in the | (vertical bar) between /etc and less.

$ ls -l /etc | less

This shows the first “page” or “screenful” of the file.

Press the Spacebar to see the next “screen” of output.

Now press the down arrow key a few times, then the up arrow, then press the Page Down key and the Page Up key.
Press the End key to go to the end of the output and then Home to go to the top of the output.

Website content

Related Posts

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark
tabs-top


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment