Find the answer to your Linux question:
Page 3 of 3 FirstFirst 1 2 3
Results 21 to 22 of 22
Check this one out, I pondered a bit with a friend of me on this one, and we got a few solutions in the direction we wanted. Its on my ...
  1. #21
    Just Joined! branneman's Avatar
    Join Date
    Jul 2010
    Location
    Rotterdam, the Netherlands
    Posts
    1

    Lightbulb Count the number of files in a directory, grouped by extension

    Check this one out, I pondered a bit with a friend of me on this one, and we got a few solutions in the direction we wanted.

    Its on my website as well: bran.name/dump/bash-build-aggregated-sorted-list-of-file-extensions-in-a-directory-and-count

    This is the one I used eventually:
    Code:
    find . -type f -exec basename "{}" \; | rev | cut -d . -f1 | rev | sort  | uniq  -c | sort  -rn
    This one works aswell, its regex based, and thus I expect it to be slower compared to cut.
    Code:
    find . -type f -exec basename "{}" \; | sed -e 's/.*\.//gi' | sort  | uniq  -c | sort  -rn

  2. #22
    Super Moderator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,144
    This thread is 5 years old....locking.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

Page 3 of 3 FirstFirst 1 2 3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...