Solved

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

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now