LinuxQuestions.org
Visit Jeremy's Blog.
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 08-31-2011, 07:46 AM   #1
soheilz92
LQ Newbie
 
Registered: Aug 2011
Posts: 4

Rep: Reputation: Disabled
Question ls command


how can have output of ls command page by page ?

and how can i have filter on ls command, for example all file start with "gc*" ?

thanks
 
Old 08-31-2011, 07:49 AM   #2
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 201

Rep: Reputation: 36
check the comands more, grep and awk, you should also like to read about pipes to pass the output of a command to another.

ls -l|more would page your results
ls gc* would get the files you want

Last edited by rodrifra; 08-31-2011 at 07:51 AM.
 
Old 08-31-2011, 08:16 AM   #3
soheilz92
LQ Newbie
 
Registered: Aug 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
how can i see the ls command output page by page ?
 
0 members found this post helpful.
Old 08-31-2011, 08:18 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,437

Rep: Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842
What was wrong with rodrifra's reply? Did you try them?
 
Old 08-31-2011, 10:21 AM   #5
flamelord
Member
 
Registered: Jun 2011
Distribution: Arch Linux
Posts: 151

Rep: Reputation: 34
an alternative to more for paging is less, which allows you to scroll both up and down (more only lets you go down I believe).
 
Old 08-31-2011, 10:55 AM   #6
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 201

Rep: Reputation: 36
You can go up and down with more too (ctrl+u and ctrl+d), at least it works with the version we have in our 5.3 AIX machines, plus you can find more in almost any *nix system, but you can not say the same about less.
 
Old 08-31-2011, 04:21 PM   #7
flamelord
Member
 
Registered: Jun 2011
Distribution: Arch Linux
Posts: 151

Rep: Reputation: 34
Quote:
Originally Posted by rodrifra View Post
You can go up and down with more too (ctrl+u and ctrl+d), at least it works with the version we have in our 5.3 AIX machines,
On my Arch Linux machine the command to go up in more is b or ctrl-b, but it only works on files, not pipes, which means it doesn't apply to the OP's problem.
Quote:
Originally Posted by rodrifra View Post
plus you can find more in almost any *nix system, but you can not say the same about less.
A fair point, although I think most Linux distributions have ls.
 
Old 09-01-2011, 01:24 AM   #8
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 201

Rep: Reputation: 36
Quote:
Originally Posted by flamelord View Post
On my Arch Linux machine the command to go up in more is b or ctrl-b, but it only works on files, not pipes, which means it doesn't apply to the OP's problem.
You're right, I did the test on our AIX machine, sorry. (In AIX it DOES work on pipes, eventhough you're right again, it doesn't seem to work on Linux pipes) .

Quote:
Originally Posted by flamelord View Post
A fair point, although I think most Linux distributions have ls.
I guess you mean less. You are right again, if you are going to work with Linux you are absolutly right, but if you are going to be administering different *nix it is easier to stick to a command which does the same job and you can find in every system than having a number of commands on different systems that do the same.
 
  


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
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM
how to copy drive using dd and tee command parallely? source code of dd command mdfakkeer Linux - Software 1 02-10-2010 01:31 PM
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 02:14 AM
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
LXer: The Linux Command Shell For Beginners: Fear Not The Command Line! LXer Syndicated Linux News 0 12-22-2008 06:30 PM


All times are GMT -5. The time now is 07:24 PM.

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