From 9b7c1f3e2bfcfac6a598a9f4c07f2dfead0e032c Mon Sep 17 00:00:00 2001 From: eslopfer Date: Mon, 13 Feb 2023 19:01:42 +0000 Subject: [PATCH] docs(dir-info): add description for exercise --- subjects/devops/dir-info/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 subjects/devops/dir-info/README.md diff --git a/subjects/devops/dir-info/README.md b/subjects/devops/dir-info/README.md new file mode 100644 index 000000000..7174a8b88 --- /dev/null +++ b/subjects/devops/dir-info/README.md @@ -0,0 +1,29 @@ +## dir-info + +### Instructions + +Create a script `dir-info.sh` that takes a directory path as input and calculates the total size of all the files in that directory and its subdirectories. + +The script will output the size of the largest file, the size of the smallest file, and the average size of all the files in the directory. + +The script will also output the name and size of all the files larger or equal than the average size and the name and size of all the files smaller than the average size. + +### Usage + +Here is an example of how to use the script: + +```console +$ ./dir-info.sh +Enter directory path: . +Largest file: ./example1.tar (30000 bytes) +Smallest file: ./example2.sh (2 bytes) +Average file size: 1279 bytes +Files larger than average size (1279 bytes): +./example1.tar 30000 +Files smaller than average size (1279 bytes): +./example3.sh 45 +./example4 248 +./example2.sh 2 +``` + +> The output should be formatted as in the example above