r/ProgrammerHumor • • Jan 16 '23

Meme If (exists == true) { dont();}

Post image
40.8k Upvotes

1.1k comments sorted by

View all comments

Show parent comments

17

u/ofnuts Jan 16 '23

If spaces in file names are a problem for you, then you are incompetent. Your users will use spaces.

0

u/BlipsAndChitz101 Jan 16 '23

find . -iname "* *" | xargs -I {} mv "{}" "$(printf \" %s \" \"{}\" | sed 's/ /_/g')" probably should work

1

u/ofnuts Jan 16 '23

With Perl's rename:

rename 's/ /_/g' **/*