[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ls sort



hi jesper,
your reply -- and even more the question you were replying to --
made me curious. i wanted to try it out. even though your command
works i wanted to define it myself from scratch -- because it's a
good way to learn and second because i don't understand all you've
written. my beginner's try was simply "ls | grep "/"" which gives
the right result. but how do i make it print the result in columns?

andrej

On Sun, Oct 14, 2001 at 12:58:56PM +0200, Jesper Holmberg wrote:
> Hi Daniel,
> 
> I don't think this is possible with the the ls options. I use a function
> specified in my /etc/profile:
> 
> ll () {
>   ls -l --color=always "$@"|grep ^d |cat
>   ls -l --color=always "$@"|egrep -v "^d|total\ [0-9]" |cat
> }
> 
> This works like ls -l, but first gives directories, then other files.
> 
> HTH
> 
> Jesper
> 
> * On Sun Oct 14, Daniel Jones wrote:
> > 
> > I'm going to feel silly if this is as easy as it seems like
> > it should be but after poring over the man pages I can't
> > figure it out.
> > 
> > Is it possible to have "ls" display contents with
> > directories listed first, sorted alphabetically, then all
> > other files, also sorted alphabetically?  None of the sort
> > options (cftuSUX) seem to include the ability to sort by
> > whether or not the file is a directory.
> > 
> > 
> 
> 
> -- 
>           Jesper Holmberg            |"But how can |
>   jesper.holmberg@enst-bretagne.fr   | one be warm |
> ENST Br, BP 832, 29285 Brest, FRANCE | alone?"     |
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: