Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

linux Oracle VM can't see full output from commands such as ls

Posted on 2009-07-12
3
Medium Priority
?
363 Views
Last Modified: 2013-11-11
Hello,

I'm using I believe the JetOS version of linux. It's Oracle VM.

It's all command line.

When I do for example any command that lists results:

ls
ls -ltr
cat

I can only see the end of the results on the screen.

In other words, I can't scroll up to see all the results.

Is there some kind of paging parameter I can use to see just a section of the results at a time and hit enter
and then go down a few lines see the next results etc?




0
Comment
Question by:ora-what
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 2000 total points
ID: 24836029
You can pipe the output through a pager such as "less". When using ls (i.e. without -l) you want to format by rows instead of columns using "ls -x". Personally I like to also use the -F option of ls, to show which entries are directories, executables and so on.
Instead of using "cat", use "less" directly.

Have you tried Shift-Page_up and Shift-Page_down? These normally give a degree of scrolling on text-only systems if you are actually at the console, may not necessarily work in a VM
ls -Fx | less
less afile
ls -Fltr | less
ls -Flt | less

Open in new window

0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 24836345
Actually "ls" is a bit more awkward to paginate than most commands because it behaves differently when stdout is a pipe. See below (lines starting # are comments)
# First determine the width of your screen
07:35:12$ stty size
25 80
 
# The second number is the width. Give this to ls (only seems to work if you also give -x)
09:06:58$ ls -xw80|less
Account.cpp               Account.cpp.bu    Account.h
Account.h.bu              Bordered$1.class  Bordered.class
Bordered.java             Bounds$1.class    Bounds$BoxedLabel.class
Bounds.class              Bounds.java       EtherLinkXL.c
 
# (further output suppressed)
# ls -Fxw80|less also works

Open in new window

0
 

Author Closing Comment

by:ora-what
ID: 31602585
the Shift + Pageup and Shift+Page down did it

thanks a million !

also very informative and educational
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will giveā€¦
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question