LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to display the results of a command screen by screen in a shell? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-display-the-results-of-a-command-screen-by-screen-in-a-shell-4175497585/)

Linux-at-last 03-09-2014 09:40 AM

How to display the results of a command screen by screen in a shell?
 
Hello there.

I am using Slackware in a shell environment.

For example, when you use the command ls it lists the contents of a directory. But if there are many objects, more than what is possible to fit in a single screen, only the last objects are shown.

So, how can one make a command show its results in a way one can see the results from start to end?

Also, how can you navigate the shell like you would in a desktop environment? I mean, when you-re running KDE for example, you can run a terminal session and scroll with the mouse to see the contents of the previous screens.

Thanks for reading.

schneidz 03-09-2014 10:04 AM

you could use less or more.

MARogue 03-09-2014 10:14 AM

Quote:

So, how can one make a command show its results in a way one can see the results from start to end?
I would try the following
Code:

ls | less

Ser Olmy 03-09-2014 10:15 AM

Quote:

Originally Posted by Linux-at-last (Post 5131502)
For example, when you use the command ls it lists the contents of a directory. But if there are many objects, more than what is possible to fit in a single screen, only the last objects are shown.

So, how can one make a command show its results in a way one can see the results from start to end?

As schneidz said, you pipe the output through one of the available paginators, the most popular by far being less:
Code:

ls -l | less
The pipe symbol grabs standard output (stdout) from the command on the left and sends it to standard input (stdin) of the command on the right.

Quote:

Originally Posted by Linux-at-last (Post 5131502)
Also, how can you navigate the shell like you would in a desktop environment? I mean, when you-re running KDE for example, you can run a terminal session and scroll with the mouse to see the contents of the previous screens.

Shift + Page Up or Page Down should work.

Linux-at-last 03-09-2014 04:41 PM

@schneidz,@MARoque,@Ser Olmy,

Thanks everyone, those commands worked perfectly.


All times are GMT -5. The time now is 08:23 PM.