LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-04-2004, 02:04 PM   #1
mykrob
Member
 
Registered: Jun 2004
Location: Jackson, TN
Distribution: Kubuntu Feisty
Posts: 606

Rep: Reputation: 31
command line help needed


Hey-
i know i can display the directory contents with the "ls" command. How can i make this pause when the screen is full, similar to the dos command "dir /p"?
I have a few directories that have more files than will fit in one screenfull.

Thanks,
-myk
 
Old 10-04-2004, 02:16 PM   #2
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
you can pipe it through a pager like more or less

Code:
ls | less
ls | more
 
Old 10-04-2004, 02:59 PM   #3
mykrob
Member
 
Registered: Jun 2004
Location: Jackson, TN
Distribution: Kubuntu Feisty
Posts: 606

Original Poster
Rep: Reputation: 31
thanks

-myk
 
Old 10-04-2004, 03:13 PM   #4
Malice132
Member
 
Registered: Sep 2004
Location: U.S.
Distribution: Mandrake 10.1
Posts: 41

Rep: Reputation: 15
Yes,
ls | less

is a great command. I personally like to add a -l

ls -l | less

which gives you the long name so you can see all the attributes. One other really useful pipe command that you make like is grep, such as, if you were searching for all files that had "bob" in them, it could go something like this:

ls -l | grep bob

This will find bob anywhere in a file, and since a lot of the time when you're looking at really large directories you really only want certain files, so this can be really helpful.
 
Old 10-04-2004, 03:16 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally posted by Malice132
ls -l | grep bob
Overkill.

ls -l *bob*
does the same and is less typing ;)


Cheers,
Tink
 
Old 10-08-2004, 01:10 AM   #6
Malice132
Member
 
Registered: Sep 2004
Location: U.S.
Distribution: Mandrake 10.1
Posts: 41

Rep: Reputation: 15
Quote:
Originally posted by Tinkster
ls -l *bob*
does the same and is less typing
Sweet. It's always the little things that are nice.
 
  


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
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 08:19 PM
Command Line e-mail client w/Authentication Needed!! rootking Linux - Software 8 12-04-2005 08:00 PM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 08:45 PM
51 characters only in the 1st Line of command line eggCover Linux - General 2 07-29-2004 02:28 PM
linux scripting help needed read from file line by line exc commands each line read atokad Programming 4 12-26-2003 11:24 PM


All times are GMT -5. The time now is 10:30 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration