Difference between revisions of "Illegal characters"
Jump to navigation
Jump to search
m (added Category:Bash using HotCat) |
(a beautiful one-liner) |
||
Line 6: | Line 6: | ||
</source> | </source> | ||
− | |||
− |
Revision as of 00:11, 2 December 2015
You're cleaning up a Linux filesystem to make it compatible with Windows (which doesn't accept the kind of characters that Linux hangs around with).
find . -name "*[<>:\\|?*]*" -exec bash -c 'x="{}"; y=$(sed "s/[<>:\\|?*]\+/-/g" <<< "$x") && mv "$x" "$y" ' \;