N
N
necros2k72019-03-17 07:34:51
Windows
necros2k7, 2019-03-17 07:34:51

What is the easiest way to sort files in a folder by format and not by extension?

Utility/script to sort say jpg to jpg folder, pdf to pdf, etc. Ideally, it would be broken jpg in, say, the jpg [cor] folder.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Mezhuev, 2019-03-17
@mezhuev

If you have Windows 10 and you are not against perversions, then you can use the Windows Subsystem for Linux:

[email protected]:/mnt/d/TEMP$ find .
.
./archive.zip
./document.pdf
./picture.jpg

[email protected]:/mnt/d/TEMP$ for F in *; do T=`file -b --mime-type "$F"`; mkdir -p "$T"; mv "$F" "$T/$F"; done

[email protected]:/mnt/d/TEMP$ find .
.
./application
./application/octet-stream
./application/octet-stream/archive.zip
./application/pdf
./application/pdf/document.pdf
./image
./image/jpeg
./image/jpeg/picture.jpg

N
Nikita Yudin, 2019-03-17
@NikitaNike

You can enter .jpg in the explorer itself in the search, it will display all files with this extension, press ctrl + A, this will select all the files and then transfer them to another folder.
If you want to do it more automatically, then google BAT files:
copy *.jpg D:\oldfiles\*.jpg - copy all files with jpg extension from the current directory to the D:\oldfiles directory

D
dollar, 2019-03-17
@dollar

Total Commander or Far.
It's a classic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question