Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This Linux command replaces characters of file names that Windows considers invalid with an underscore, to make the files accessible and manageable on Windows again. Renamed files are logged to record their original names.
rename -v "s/(:|\"|\*|\\|\||\&|\?|\%|\<|\>)/_/g" .* * |tee -a renamed_files.$(date +%Y%m%d%H%M%S).log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment