Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3331702
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:36:40+00:00 2026-05-17T23:36:40+00:00

There are so many goodies that come with a modern Unix shell environment that

  • 0

There are so many goodies that come with a modern Unix shell environment that the thing I need is almost always installed on my machine or a quick download away; the trouble is just finding it. In this case, I’m trying to find basic statistical operations.

For example, right now I’m prototyping a crawler-based app. Thanks to wget plus some other goodies, I now have a few hundred thousand files. So I can estimate the cost of doing this with billions of files, I’d like to get the mean and median of file sizes over a certain limit. E.g.:

% ls -l | perl -ne '@a=split(/\s+/); next if $a[4] <100; print $a[4], "\n"' > sizes
% median sizes
% mean sizes

Sure, I could code my own median and mean bits in a little bit of perl or awk. But isn’t there already some noob-friendly package that does this and a lot more besides?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:36:40+00:00Added an answer on May 17, 2026 at 11:36 pm

    Can you install R ? Then littler and its r command can help:

    ~/svn/littler/examples$ ls -l . | awk '!/^total/ {print $5}' 
    87
    1747
    756
    988
    959
    871
    ~/svn/littler/examples$ ls -l . | awk '!/^total/ {print $5}' | ./fsizes.r 
       Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
         87     785     915     901     981    1750 
    
      The decimal point is 3 digit(s) to the right of the |
    
      0 | 1
      0 | 89
      1 | 00
      1 | 7
    
    ~/svn/littler/examples$ cat fsizes.r 
    #!/usr/bin/r -i
    
    fsizes <- as.integer(readLines())
    print(summary(fsizes))
    stem(fsizes)
    

    This is example we had used before, hence the R function summary() which contains median() and mean() as well as an ascii-art alike stem plot. Generalization to just calling median() or mean() are of course pretty straightforward.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are many similar questions, but I didn't find one that gets straight to
There are many questions like this but I can't find one that seems to
there are many posts that deal with validation controls inside update panel and partial
There are many Web sites that include clickable maps that highlight regions on mouseover
There are many questions on here about caching that doesn't work properly, or asking
There are many techniques to enforce strong passwords on website: Requesting that passwords pass
There were many questions about C++ template classes which contain static member variables, as
There are many errors here in SO, but this scenario I think its different.
There are many similar questions, however they don't answer the problem of a url
There are many services available for delivering content to users. I am looking for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.