'cut' might work well also.

> ls | cut -f1 -d@ | sort | uniq -c

to get a list in sort order, or

> ls | cut -f1 -d@ |sort | uniq -c | sort -n

to get a list ordered by frequency.

--- David Fleck

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Tuesday, August 17th, 2021 at 1:46 AM, Russell Senior 
<russ...@personaltelco.net> wrote:

> From the uniq manpage:
>
> Note: 'uniq' does not detect repeated lines unless they are
>
> adjacent. You may want to sort the input first, or use 'sort -u'
>
> without 'uniq'. Also, comparisons honor the rules specified by
>
> 'LC_COLLATE'.
>
> On Mon, Aug 16, 2021 at 10:45 PM wes p...@the-wes.com wrote:
>
> > On Mon, Aug 16, 2021 at 8:45 PM Randy Bush ra...@psg.com wrote:
> >
> > > can you point me to where it is documented that `find` is guaranteed
> > >
> > > to produce an ordered list?
> >
> > I don't have any such documentation or belief. my belief is that uniq will
> >
> > count non-consecutive matches, that's what I'm relying on. however, sorting
> >
> > first doesn't hurt anything, so have at it.
> >
> > yeah, awk is often a more appropriate tool for this type of job, it's just
> >
> > that I happened to learn sed first, so I default to that. it's the same
> >
> > reason I use vi instead of emacs, it's largely down to complete coincidence.
> >
> > -wes

Reply via email to