coreutils
[Top][All Lists]
Advanced

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

Re: make ls -l dir1 dir2 in the same order as dir1,2 are specified


From: Glenn Golden
Subject: Re: make ls -l dir1 dir2 in the same order as dir1,2 are specified
Date: Sat, 27 Mar 2021 13:34:34 -0600
User-agent: Cyrus-JMAP/3.5.0-alpha0-273-g8500d2492d-fm-20210323.002-g8500d249

On Sat, Mar 27, 2021, at 13:24, L A Walsh wrote:
> On 2021/03/26 14:03, Peng Yu wrote:
> > Hi,
> >
> > When I try `ls -l dir1 dir2`, the order of dir1 and dir2 in the output
> > is not necessarily the same as the input. How to make it the same as
> > the input order? Thanks.
> >   
> Use separate invocations of 'ls' to guarantee the order of output
> of the arguments.
> 
> When you put more than one name on the command line, you will get
> some type of sorted order or the order they appear on disk.
> 
>

Output ordering rules for ls are covered in Section 10.1.3 of coreutils.info:

   $ info ls

and then navigate to "Sorting the output" (which is the above-named section.)

Simply

   $ ls -fl dir1 dir2

will produce what the OP asked for.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]