Copy Files From Flash Drive To Ubuntu

0

I am attempting to copy files from my flash drive to my local drive on Ubuntu. This is the command that I ran

sudo cp -i  /media/owner/ESD-USB/mysql /var/lib/

But that output a message of - and the files were not copied over (replacing the original files)

cp: omitting directory '/media/owner/ESD-USB/mysql'

What do I need to do in order to copy this directory from my flash drive and over write the current directory on my hard drive?

user2676140

Posted 2016-06-18T21:00:36.647

Reputation: 1 629

Answers

0

You give directory as source argument and expect cp to copy the files. To do this, use -r (recursive) option:

sudo cp -r -i /media/owner/ESD-USB/mysql /var/lib/

This will create (or overwrite the content of) /var/lib/mysql/ directory. You probably want it that way. Otherwise, if you want to copy the files from within mysql to /var/lib/ (i.e. not to /var/lib/mysql/) you may use:

sudo cp -i /media/owner/ESD-USB/mysql/* /var/lib/

Kamil Maciorowski

Posted 2016-06-18T21:00:36.647

Reputation: 38 429