Hi, Philip, Thank you for your idea. This does keep the colors.
I rewrite it as: function d() { x=`find * -type d -maxdepth 0` [[ -n $x ]] && l -d $x x=`find * -type l -maxdepth 0` [[ -n $x ]] && l $x x=`find * -type f -maxdepth 0` [[ -n $x ]] && l $x unset x } to avoid redundant output while nothing *found*. It works fine w/o delay. * However, I wish mutt's file browser can also improve like this to make our life easier. :-) best regards, charlie On Mon, Feb 04, 2002 at 11:53:58AM -0500, Philip Mak wrote: > On Tue, Feb 05, 2002 at 12:46:17AM +0800, Charles Jie wrote: > > 2. The 'ls' don't group directories/files into two part. > > - If you code something to achieve it, you lose the COLORs. > > Try typing this and see if it does what you want: > > ls -d `find * -type d -maxdepth 0`; ls `find * -type f -maxdepth 0` > > You could put this in your .bashrc (or equivalent file): > > alias dir=ls -d `find * -type d -maxdepth 0`; ls `find * -type f -maxdepth 0` > > and then just type "dir" and you will see the directories, followed by > the files, and it's sorted and has color. > > Warning: It might not work right for directories that have a huge > number of files due to limits in argument list length.