Changes

Jump to: navigation, search

OPS435 Assignment 1 for Section C

13 bytes removed, 14:33, 1 February 2021
Overview: du Improved
<code>du</code> is a tool for inspecting directories. It will return the contents of a directory along with how much drive space they are using. However, it can be parse its output quickly, as it usually returns file sizes as a number of bytes:
<code><b>user@host ~ $ du --max-depth 1 /usr/local/lib</b></code>
<pre><code>
164028 /usr/local/lib/heroku
11072 /usr/local/lib/python2.7
8 /usr/local/lib/python3.8
267720 /usr/local/lib
</code></pre>
You will therefore be creating a tool called <b>duim (du improved></b>. Your script will call du and return the contents of a specified directory, and generate a bar graph for each subdirectory. The bar graph will represent the drive space as percent of the total drive space for the specified directory.
An example of the finished code your script might produce is this:

Navigation menu