"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. |
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 |
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. |
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. |
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. |
or try:
ls -m |
ls --color | less -R
(man less) |
Print to Windows print server
How do I print to a Windows printer server?
Do I need to enable the local "lpd"? |
Quote:
|
Quote:
Code:
alias ls = "ls -F | less" #or whatever |
Well that was easy now wasn't it. :)
Thank you cuckoopint. |
moses, that's cool tip
thanks |
All times are GMT -5. The time now is 09:33 PM. |