Dealing with spaces in filenames

As I always forgot how to properly deal with it when scripting things -.-, here is one solution on how to deal with spaces in file names and processing it properly in a loop.

find . -print0 | while read -d $'\0' i; do mv "$i" ./; done

Source: http://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html

No comments:

Post a Comment