How expensive is SF rent? Here&#x27;s a coding challenge that uses Unix command line tools to find out.<p>Hacker friends suggested I post the result and code here because I&#x27;m writing open source statistics software and this is a practical example of results and code.<p>The results for a one bedroom in SF: mean $3348, median $3475, interquartile range $1514, and standard deviation $1130.<p>How to use Unix commands to find out: use `curl` to fetch Craigslist apartment listings, then `sed`, `grep`, and `tr` to filter and parse the data, then `num` to calculate the statistics.<p><pre><code>    curl -s http:&#x2F;&#x2F;sfbay.craigslist.org&#x2F;search&#x2F;sfc&#x2F;apa\?min_price\=1\&amp;bedrooms\=1 |
    sed &#x27;s&#x2F;\(&lt;p class=&quot;row&quot;\)&#x2F;\n\1&#x2F;g&#x27; |
    grep &#x27; 1br &#x27; |
    tr &quot;&gt;&quot; &quot;\n&quot; |
    sed -n &#x27;s&#x2F;^\$\([0-9]\+\).*&#x2F;\1&#x2F;p&#x27; |
    num mean median interquartile-range standard-deviation OFMT=&quot;%.0d&quot;
</code></pre>
The software I&#x27;m personally writing is the `num` command to calculate the statistics. The software is free at http:&#x2F;&#x2F;www.numcommand.com
How expensive is SF rent? Use Unix commands to find out