Linux CP command

keith smith klsmith2020 at yahoo.com
Thu Aug 12 17:02:56 MST 2010


I did the tab thing still the same results.  I usually use the tab completion because it ensures I am using the right name.

mysql]$ sudo cp /var/lib/mysql/DB1/* /var/lib/mysql/DB2/ 

Results : cp: cannot stat `/var/lib/mysql/DB1/*': No such file or directory

If i do :  sudo vdir /var/lib/mysql/DB1/*

I get vdir: /var/lib/mysql/baseline/*: No such file or directory

If I remove the asterisk like this : sudo vdir /var/lib/mysql/DB1/ 

I get a list of the directory DB1.

if I issue the command 

sudo cp /var/lib/mysql/DB1/ /var/lib/mysql/DB2/

it creates a directory DB2/DB1 and copies all the files from DB1

I thought this would be a quick and dirty was to setup a testing DB.  

I guess I'll have to do it the mysqldump way!

------------------------

Keith Smith

--- On Thu, 8/12/10, Lisa Kachold <lisakachold at obnosis.com> wrote:

From: Lisa Kachold <lisakachold at obnosis.com>
Subject: Re: Linux CP command
To: "Main PLUG discussion list" <plug-discuss at lists.plug.phoenix.az.us>
Date: Thursday, August 12, 2010, 4:36 PM

Hi Kevin:

On Thu, Aug 12, 2010 at 4:17 PM, keith smith <klsmith2020 at yahoo.com> wrote:


Hi,

For some reason I just don't get the cp command.  Maybe it is the deep rooted MS DOS from the 80's and 90's.  I spent about a decade using MS DOS.


Here is what is going on.  I am in a CentOS box and do not ever become root.  I use sudo.

I want to copy one MySql DB to another so I can use the data for testing.

1) I cd to /var/lib/mysql
2) I can see both DB's

3) I issue any number of commands that do not work.

Lets say DB1 is the source directory & DB2 is the destination directory

mysql]$ sudo cp DB1/*.* DB2/  Results: cp: cannot stat `DB1/*.*': No such file or directory


mysql]$ sudo cp DB1/* DB2/  Results: cp: cannot stat `DB1/*': No such file or directory

mysql]$ sudo cp DB1/ DB2/  Results: creates the directory DB1 under DB2 and copies all the files
 into DB2/DB1

mysql]$ sudo cp DB1 DB2/  Results: does not seem to do anything.

http://www.computerhope.com/unix/ucp.htm shows this example: cp -r /home/hope/files/* /home/hope/backup


mysql]$ sudo cp -r /var/lib/mysql/DB1/* /var/lib/mysql/DB2 - cp: cannot stat `/var/lib/mysql/baseline/*': No such file or directory

This is driving me crazy.  Any help much appreciated!
 
------------------------


Keith Smith


Linux is exactly like a good domestic or business partner, telling you very clearly directly and completely what an issue might be.

It it says:  
cannot stat `/var/lib/mysql/baseline/*': No such file or directory

There IS not such file or directory.
Did you run a nice:

ls -al

first to determine what was there?
You can use the TAB key to autocomplete your commands, which is very useful for linux.

It sounds like you might actually want a mysqldump and import instead?


 -- 
Office: (602)239-3392
AT&T: (503)754-4452 

http://it-clowns.com
"Faith is, at one and the same time, absolutely necessary and altogether impossible.
"
--Stanislav Lem















-----Inline Attachment Follows-----

---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20100812/4d38ea28/attachment.html>


More information about the PLUG-discuss mailing list