LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-09-2014, 10:40 AM   #1
Linux-at-last
LQ Newbie
 
Registered: Mar 2014
Posts: 10

Rep: Reputation: Disabled
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.
 
Old 03-09-2014, 11:04 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,029

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
you could use less or more.
 
Old 03-09-2014, 11:14 AM   #3
MARogue
Member
 
Registered: Jul 2011
Location: USA
Distribution: Ubuntu 12.04 , Debian "Wheezy"
Posts: 56

Rep: Reputation: Disabled
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
 
Old 03-09-2014, 11:15 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
Quote:
Originally Posted by Linux-at-last View Post
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 View Post
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.
 
Old 03-09-2014, 05:41 PM   #5
Linux-at-last
LQ Newbie
 
Registered: Mar 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
@schneidz,@MARoque,@Ser Olmy,

Thanks everyone, those commands worked perfectly.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Why no cls or some other clear screen command for the shell? Arcosanti Linux - Newbie 5 08-21-2012 12:12 AM
Clear Screen Command for BASH Shell erora Linux - Newbie 3 01-21-2010 10:03 PM
How to Stop Command Results from Scrolling Off the Screen ahr8tch Linux - Newbie 6 12-16-2009 01:32 AM
Linux Command login screen, Display Script? roclok Linux - Software 2 06-14-2006 01:22 AM
Startx results in a black screen with VGA and screen errors kwosource Linux - Newbie 4 03-11-2005 03:58 PM


All times are GMT -5. The time now is 08:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration