News for hackers. Stuff that matters.
Re:I'm “still afraid to use spaces in file names” years old by niccl on Thursday November 11, 2021 @01:38PM (#29191354)
I use this snippet, to change spaces to underscore for directories and files in the current directory and below. Haven't made it a function yet, but should. I got it from stack overflow or somewhere, but no attribution. Thanks to whoever did it first:

   find . -depth -name '* *' | while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' _)" ; done

There are no comments on this comment yet.