Rename a file with mv

1 reply [Última entrada]
amenex
Desconectado
Joined: 01/03/2015

This ought to be a trivial task ...
But I'm faced with a directory of 75 files with similar names, which mv ought to handle with ease:
mv oldfilename newfilename
except that my old file name has spaces:
mv old file name newfilename
which elicited the response:
"newfilename" is not a directory

I've always resisted leaving spaces in filenames, but this time I was in a hurry.
Is there a geek way that's quicker than renaming them one-at-a-time with the
file manager ?

George Langford

amenex
Desconectado
Joined: 01/03/2015

Thank You JLB !

The geek way is indeed quicker. Took me 32 minutes the hard way; and I made a couple of errors.

In all the Google pages that I consulted before asking my question, none brought up your most elegant method.

I shoulda known ... in the paste command, I routinely type paste -d '[space]' to signify separating the
files with spaces. Same idea.