#Disk Usage - Housekeeping

##Introduction

In a Unix environment it is often useful to have an idea what are the biggest file we have stored in a particular directory and maybe get rid of the bigger ones, in case they are not used anymore. This would be our housekeeping task.

Ideally we would like to have a shell script that recursively finds the 5 biggest files in the current directory and its children. Suppose we name the script "fbig", we would like to have the following options when calling this script:

  • Call it without arguments: E.g.: $./fbig. This would recursively find the 5 biggest files.
  • Call it with one argument, $minimum_size: E.g.: $./fbig 100M This would return the 5 biggest files (if any) which size is >= than the given parameter.
  • Call it with two arguments, $minimum_size and $maximum_size: E.g.: $./fbig 10M 25M This would return the 5 biggest (if any) files with sizes between [10,25] MB

##Goal

Your goal is to write a shell script that meets the requirements specified above. You can use any Unix tool. but we recommend the following: find, awk, sort and head.

##Start

  1. Fork the repository

    • git clone https://github.com/cuevae/code-katas-unix-disk-usage-housekeeping.git
    • cd code-katas-unix-disk-usage-housekeeping;
  2. Check you are good to go

    • Run start.sh, you should see "Good to go!" echoed in the command line
    • Star modifying fbig.sh to carry out its tasks
  3. Once you've finished you can create a Pull Request and submit a branch with your solution