-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcleanup.sh
executable file
·38 lines (36 loc) · 924 Bytes
/
cleanup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
if [[ ! -d PDFs ]]; then
mkdir PDFs
fi
if [[ ! -d Images ]]; then
mkdir Images
fi
if [[ ! -d GIFs ]]; then
mkdir GIFs
fi
if [[ ! -d Audios ]]; then
mkdir Audios
fi
if [[ ! -d Archives ]]; then
mkdir Archives
fi
if [[ ! -d Docs ]]; then
mkdir Docs
fi
if [[ ! -d E-Books ]]; then
mkdir E-Books
fi
if [[ ! -d Code ]]; then
mkdir Code
fi
# if [[ ! -d Mics ]]; then
# mkdir Misc
# fi
mv -v ./*.pdf ./*.PDF ./PDFs/ 2> /dev/null
mv -v ./*.jpg ./*.jpeg ./*.png ./*.svg ./Images/ 2> /dev/null
mv -v ./*.gif ./GIFs/ 2> /dev/null
mv -v ./*.tar.bz2 ./*.tar.gz ./*.bz2 ./*.rar ./*.tbz2 ./*.gz ./*.tgz ./*.zip ./*.Z ./*.7z Archives/ 2> /dev/null
mv -v ./*.mp4 ./*.amr ./*.mp3 ./Audios/ 2> /dev/null
mv -v ./*.docx ./*.doc ./*.md ./*.odt ./*.ppt ./*.csv ./*.xlsx ./*.pptx ./Docs/ 2> /dev/null
mv -v ./*.mobi ./*.epub ./E-Books/ 2> /dev/null
mv -v ./*.c ./*.cpp ./*.sql ./*.py, ./*.ipynb ./*.java ./Code 2> /dev/null