Solved

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

Posted on 2009-07-12
3
346 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 34

Accepted Solution

by:
Duncan Roe earned 500 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 34

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Ubuntu not booting - How get past GRUB? 3 43
how to rebuild XFS volume from LV 19 65
awk sed 8 44
Run Secure WMI query from CentOS 5 33
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Fine Tune your automatic Updates for Ubuntu / Debian
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

803 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