I\'m trying to rename a bunch of files which contain spaces in them, getting rid of the spaces. I thought I found the correct bash command:
for f in *.txt; do m
Because this is the first thing that came up on google when googling this error, I thought I'd add a bit.
This error occurs if you have more than two arguments and the last result is not a directory.
This works:
mv file1.txt output.txt
This does not:
mv file1.txt file2.txt
In my case I was doing: mv prefix_* output_file_name
to ensure a downloaded file had a consistant name, but another file had appeared in the directory, restulting in the "mv target is not a directory" error