LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-02-2006, 11:35 PM   #1
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Rep: Reputation: 30
Output ls one screen at a time


Whats the Linux equivalent of DIR | MORE ?
Googling Linux DIR | MORE is returning something else.

Thanks
 
Old 01-02-2006, 11:52 PM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
ls |more
ls |less
The second one allows you to scroll forward and backward
 
Old 01-03-2006, 12:03 AM   #3
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
Thanks. And whats the Windows equivalent of CTRL + C ?I want to break in the middle but ESC or CTRL + C isnt doing the job. Using Putty though.

And finally then the list is over, it shows (END) highlighted. How do I resume back to shell ?

Last edited by anjanesh; 01-03-2006 at 12:06 AM.
 
Old 01-03-2006, 12:38 AM   #4
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Ctrl-C is that command in Linux as well, not sure how it works over FTP. If you can open multiple sessions, you can use "killall <programname>" or "ps" to list processes and their PIDs and then "kill <PID>" to kill it that way.

When piping something to less (remember, less is more than more ), you just press "q" at the end to get out (type "h" to get info on all available options).
 
Old 01-03-2006, 01:34 AM   #5
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
Say I enter ls -l
There are 1000's of files in that directory so it'll take a long time to list. I want to break in the middle of it - just like the way we do in Windows - CTRL + C. But thats not working in Putty
 
Old 01-03-2006, 01:51 AM   #6
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
I doubt puTTY can interpret the Ctrl character, and so it can't be passed onto the tunneled computer.

Something tells me that wouldn't work regardless of the OS at the other end, being a limitation of puTTY.

There should be a way to limit the output to, say, 500 entries or whatnot. Off the top of my head I can't think of how, but I'm sure someone more experienced can help you in that regard.
 
Old 01-03-2006, 01:51 AM   #7
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Ctrl-C should work in Linux, I'm guessing FTP is set up in a way where that won't work for some reason. I'd suggest "ls -l | less" and scrolling down to the part you want. Type "h" to see all the options, you can go to a line number, search for words, etc. to find the section you need. Or if you just want the first certain number of lines look at "head -n"
 
Old 01-03-2006, 02:04 AM   #8
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
Quote:
I'm guessing FTP is set up in a way where that won't work for some reason.
- Using SSH.
And even I do type ls -l | less, the problem is, I still cant get out of it in the middle - and even worse - when ls -l | less is over, it displays a highlighted (END) from which Im unable to get out - I had to close Putty altogether.

What do you guys use for remote accessing of a Linux Server ?
Would it be far more easier, better if I have a Linux PC to access my remote Linux Server ?

Thanks
 
Old 01-03-2006, 02:45 AM   #9
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
He said it before, press 'q'.
 
Old 01-03-2006, 03:18 AM   #10
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 12.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
Ah..thanks..q does work for ls | more and ls | less but not just for ls.
 
Old 01-03-2006, 04:50 AM   #11
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Of course not, since "ls" just prints everything in one go. It doesn't put any pauses in the middle, so you
can't interrupt it (unless with Ctrl-C, but that may not work with PuTTY, as has been said earlier).

ls|more and ls|less actually take the output of "ls" and feeds that as input to "more" or "less" (same way
as on Windows). "more" and "less" then print the lines, but with pauses after each page. During such a pause,
you can jump out with "q".
 
  


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
output to screen from a deamon csfalcon Programming 10 04-22-2005 02:14 AM
manipulating the output of time command garodin Programming 2 03-29-2005 06:13 AM
ALSA sound: One output at a time :( Erik Plaggenmar Linux - Software 4 10-09-2004 04:12 AM
I am a big time newbie. No video output for X Windows. Help. sabaka Linux - Software 8 09-07-2003 11:33 AM
output of time command! Valluvan Linux - Software 1 08-21-2003 06:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:18 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