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

Re: ls sort



[ I missed the original, but here's some comments anyways ]

| On Sun, Oct 14, 2001 at 12:58:56PM +0200, Jesper Holmberg wrote:
| > * 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.

| > 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.

This is neat.

One option I really like, and thus put in my 'ls' alias is -p.  This
displays a '/' at the end of directory names.  This may not be
necessary with coloring, but I like it (and don't always have color,
eg on solaris).

-D



Reply to: