changes file-extension based on mime-type
- removes
*?|^:"<>
characters from the file-name - reducing multiple spaces, dots, and underscores
- adds rename-date suffix to ensure uniquness of the filename
- strips exec-flag from non-executive types (usual leftover from FAT/NTFS)
- optimizes images while at it (shows reduction size in
kb
and%
)
- look at install file for instructions
- adjust
PREFIX
at wish - make sure the final directory is on
$PATH
rename-ext /Data/Pictures/_unsorted/**/*
to only change extension and nothing else:
rename-ext --only-ext /Data/Photos/2020/*
to only print a report:
rename-ext --test-run /Data/Docs/_dump/*
file
- to determine file typesd
– better sedjpegoptim
– to compress JPEGsimagemagick
orgraphicsmagic
– to mogrify PNGspngcrush
– to compress PNGs
- find better determination tool for
application/octet-stream
- leverage
fd
to do recursive paralel execution if some of parameters are folders
Q: why not just rename files to hashes of their contents, and store original filenames in some database?
A: good point. that database is in my case a filesystem itself.