Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions hemant_bhakar/assignment-1/Readme.md
Original file line number Diff line number Diff line change
@@ -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)
Binary file added hemant_bhakar/assignment-1/Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions hemant_bhakar/assignment-1/script.sh
Original file line number Diff line number Diff line change
@@ -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