LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-19-2003, 12:36 AM   #1
correro
Member
 
Registered: Oct 2002
Distribution: RedHat 8.0
Posts: 140

Rep: Reputation: 15
"ls" option


What option should I use if I want to list contents of a directory page by page while not using the pipe " | more"?

I checked the man page of "ls", but didn't find the option I need.
 
Old 03-19-2003, 12:59 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
ls | less

Is that what you mean? Or you just want to append to ls with a -something rather? You don't wanna pipe it to anything? Hmmm... If that is the case I am not too sure, I usually pipe it to less.

Cool
 
Old 03-19-2003, 01:28 AM   #3
correro
Member
 
Registered: Oct 2002
Distribution: RedHat 8.0
Posts: 140

Original Poster
Rep: Reputation: 15
no, that's not what i mean.

certainly i can use "more" or "less", but if i do so, i lose the coloring.

what i'm looking for is an option for "ls" with which i can view contents of a directory page by page and still keep the different colors indicating directories or links or normal files.
 
Old 03-19-2003, 04:24 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well that's not really and of ls's business, it's more down to the shell you are using. by default the newer versions of bash will automatically stop after each screenful of information, whatever program you are using. i can't remember the Xresource to set for it, but try upgrading bash, and i'll have a look what i get home as you may well be able to just turn it on without upgrading.

hopefully you can see why ls doesn't do this from the modularity of unix. ls's job is to show lists of files, not deal with terminal scrolling etc, so whilst old DOS dir can use /p it's a design hack and in the purest sense shouldn't be there.
 
Old 03-19-2003, 08:38 AM   #5
NGene
Member
 
Registered: Mar 2001
Location: Turku, Finland
Distribution: Ubuntu
Posts: 66

Rep: Reputation: 16
One way to cope with this issue would be to use -F option with ls, like
ls -F | less

This way it puts different signs at the end of your file names, depending on what type they are. Then you'd be able to see the type of your files even though you don't get the colors.
 
Old 03-19-2003, 09:20 AM   #6
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
or try:

ls -m
 
Old 03-19-2003, 09:28 AM   #7
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
ls --color | less -R

(man less)
 
Old 03-19-2003, 07:44 PM   #8
correro
Member
 
Registered: Oct 2002
Distribution: RedHat 8.0
Posts: 140

Original Poster
Rep: Reputation: 15
Print to Windows print server

How do I print to a Windows printer server?

Do I need to enable the local "lpd"?
 
Old 03-21-2003, 09:40 PM   #9
rickenbacherus
Member
 
Registered: Mar 2003
Location: colorado springs. colorado
Distribution: Debian-Sid 2.6.24-rt1
Posts: 290

Rep: Reputation: 30
Quote:
Originally posted by NGene
One way to cope with this issue would be to use -F option with ls, like
ls -F | less

This way it puts different signs at the end of your file names, depending on what type they are. Then you'd be able to see the type of your files even though you don't get the colors.
Exactly what I needed! -a workaround for being colorblind! Would it be possible to make that the default behavior?

Last edited by rickenbacherus; 03-21-2003 at 09:42 PM.
 
Old 03-21-2003, 10:13 PM   #10
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
Quote:
Would it be possible to make that the default behavior?
make an alias in ~/.bashrc

Code:
alias ls = "ls -F | less"    #or whatever
 
Old 03-21-2003, 11:46 PM   #11
rickenbacherus
Member
 
Registered: Mar 2003
Location: colorado springs. colorado
Distribution: Debian-Sid 2.6.24-rt1
Posts: 290

Rep: Reputation: 30
Well that was easy now wasn't it.
Thank you cuckoopint.
 
Old 03-22-2003, 01:17 AM   #12
doublefailure
Member
 
Registered: Mar 2002
Location: ma
Distribution: slackware
Posts: 747

Rep: Reputation: 30
moses, that's cool tip
thanks
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
"Refer To" option to point questioners to existing discussion/material sboddy LQ Suggestions & Feedback 6 12-01-2005 02:14 AM
XF86Config : Option "Resolution" "800" carboncopy Slackware 2 12-16-2003 10:13 PM
Option "ZAxisMapping" "4 5" won't work apax Linux - Hardware 7 11-06-2003 09:41 AM
anging "Protocol" option to "IMPS/2" in XF86Config-4 causes problems zstingx Linux - General 2 10-27-2003 09:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:49 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
Open Source Consulting | Domain Registration