[CLUG] mv and dirs...

Baldwin_James at emc.com Baldwin_James at emc.com
Wed Mar 6 13:13:37 GMT 2002


[SORRY ABOUT PREVIOUS INCOMPLETE POST   DAMN...OUTLOOK]

Hi all...

I am baffled by something which may be simple..I must be doing something
stupid..

I have some dirs/files I want to move into existing child directories but
when a directory already exists for a dir I am trying to move over, mv will
just complain with the usual (/mv: /dir/dir/dir is a directory) and it will
fail to copy that directory and all child files/dirs within it..

Let me illustrate...

I have these which I want to move back into position..
E.g.
/files/archive/2001-01/<load of files>
/files/archive/2001-02/<load of files>
/files/archive/2001-03/<load of files>
/files/archive/2001-04/<load of files>
/files/archive/2001-05/<load of files>

I want to put these back into an existing directory of /files
existing dir ls is 
/files/2001-01/
/files/2001-02/
/files/2001-03/

Now, if I ' mv -i /files/archive/* /files/ '  the 2001-01,2,3 will fail with
(mv: /files/2001-1 is a directory) but the 2001-4,5 will be fine as no dir
currently exists for them.


I am thinking of explicitly specifying filenames for the move by a find .
-print | xargs, but is there any other way around this?
Copy is not an option....with the F/s being 93% full

TIA,

James.




More information about the Cork mailing list