I have a directory with huge number of files with different extensions. What I want to do is to move each extension to a folder with name the extension itself, and those files without extension move to a folder named unkown
.
For example I have the files a.txt
, b.txt
,a.pdf
, b.pdf
, a.mp4
, file
, newfile
....
The result would be 4 dirs named txt
, pdf
, mp4
, unkonw
the txt
dir contains the files a.txt
, b.txt
the pdf
dir contains the files a.pdf
, b.pdf
the mp4
dir contains the files a.mp4
the unkonw
dir contains the files file
, newfile
a.txt
andb.txt
to thetxt
directory andfile
andnewfile
to theunknown
directory. Also I want to ask are there only these four extensions or are there many more?