0

I am trying to copy an mp3 file from my Downloads directory to an external USB drive.

The directory where the file is: /home/uffa/Downloads

file name: Chaka Khan A Night In Tunisia.mp3

I used this command as root:

root@ronja:/home/uffa# cp -R /home/uffa/Downloads/Chaka Khan A Night In Tunisia.mp3 /media/uffa/003A63E53A63D666

The output looks like this:

cp: cannot stat '/home/uffa/Downloads/Chaka': No such file or directory
cp: cannot stat 'Khan': No such file or directory
cp: cannot stat 'A': No such file or directory
cp: cannot stat 'Night': No such file or directory
cp: cannot stat 'In': No such file or directory
cp: cannot stat 'Tunisia.mp3': No such file or directory

It will not work!

I have set the permission for the file to "read and write"

Update: As a workaround, I was able to copy the file to a WD Elements USB drive, but not to a USB stick. So no need for help anymore except to have an explanation why it will mot work to copy to a USB stick.

NotTheDr01ds
  • 22,082
froda
  • 1

1 Answers1

1

What is attempted to copy is not what you asked the system to copy.

The Ubuntu command processor (probably bash) will pass each parameter as a separate entity. Those parameters DO NOT HAVE SPACES because, a space is the delimiter between parameters. You asked to copy several files: Chaka, Khan, A, Night, In and finally Tunisia.mp3

Quotes are used to optionally start and end parameters. Within those quotes, you may have spaces. Had you put the input file name in quotes, it probably would have worked.

Using quotes and spaces, you can really drive others nuts - consider

aa b.mp3

(simple - just a space between aa and b)

aa b.mp3

(here we have a more difficult example - that's a triple space in the file name)

aWildOne .mp3

(looks OK except notice the space just ahead of the file extension)

aSong.mp3

(looks simple but the file extension in this case is four characters: m,p,3,space

The short of all this is, if there are spaces - put it in quotes.

sudodus
  • 47,684
quill
  • 1,015