[CLUE-Tech] Command line order

Lynn Danielson Lynn.Danielson at clue.denver.co.us
Wed Dec 6 10:01:18 MST 2000


Kevin Cullis wrote:
> "Jeffery C. Cann" wrote:
> > On Tuesday 05 December 2000 10:08, Kevin Cullis wrote:
> > >
> > > I did the ls -fl AND an ls -lf and got two different displays.
> >
> > In general, the order does not matter.  I tried cat -vet file and cat -tev
> > file and observed the same results.
> 
> Then did you try my stuff and see what happens?  I'm now curious as to
> why this might be happening.  Could it be BASH that might cause this?

Kevin, Grant already gave you the answer to this question.  The -l and -f 
switches are incompatible.  You get the results of one or the other, they
do not work together.  The man page 

As to why you get different results depending on the switch ordering.  I
can only guess from actually looking at the results.  The way GNU ls seems
to work is -- if there is a conflict between switches the last one wins.  
Therefore, if "ls -lf" is equivalent to "ls -f" and "ls -fl" is equivalent
to "ls -l".  This is not clearly documented in the man or info pages, but
it's clearly the way it works (at least in this case).  The "ls" command is 
not a built-in shell command, so bash has nothing to do with its operation.

On Solaris, the "-f" switch always disables the "-l" switch (among others)
regardless of the order.  This method of operation may make more sense to
you.  But as we all know, GNU's not UNIX.

Lynn



More information about the clue-tech mailing list