I've been experiencing a wee issue in attempting to rename a batch of files. I need to insert (retrospectively) hyphens between a string of words in a group of unrelated files. I thought i would employ sed to replace the white spaces with hyphens and I arrived at this (please see below). Now this returns the correct result on the command-line, but, doesn't physically change the file name in the directory.
$ ls 'long long long filename.txt' | sed 's/\s/-/g'
output
long-long-long-filename.txt
Any help or suggestion would be much appreciated.