diff --git a/hemant_bhakar/assignment-1/Readme.md b/hemant_bhakar/assignment-1/Readme.md new file mode 100644 index 0000000..70899b1 --- /dev/null +++ b/hemant_bhakar/assignment-1/Readme.md @@ -0,0 +1,9 @@ +# Assignment-1 +## File Sorter +This is my submission for final boss assignment. + +The script `script.sh` contains bash commands for grouping files based on there type and storing them in directories `Data`, `Images`, `Docs`, `Models`, `Scripts`. + +When you run the `script.sh` it asks user for the address of directory of which the user wants to sort files for. + +![Screenshot](Screenshot.png) diff --git a/hemant_bhakar/assignment-1/Screenshot.png b/hemant_bhakar/assignment-1/Screenshot.png new file mode 100644 index 0000000..0d3b360 Binary files /dev/null and b/hemant_bhakar/assignment-1/Screenshot.png differ diff --git a/hemant_bhakar/assignment-1/script.sh b/hemant_bhakar/assignment-1/script.sh new file mode 100644 index 0000000..5d01d3c --- /dev/null +++ b/hemant_bhakar/assignment-1/script.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +read -p "Give the directory path name you want to sort: " dir + +cd "$dir" +mkdir Scripts Data Images Models Docs 2>/dev/null +mv *{.txt,.py,.sh,.ipynb} Scripts/ 2>/dev/null +mv *{.csv,.xlsx,.json,.xml} Data/ 2>/dev/null +mv *{.jpg,.png,.jpeg,.heic} Images/ 2>/dev/null +mv *{.pkl,.joblib} Models/ 2>/dev/null +mv *{.pdf} Docs/ 2>/dev/null +rmdir Scripts Data Images Models Docs 2>/dev/null +ls Scripts Data Images Models Docs 2>/dev/null