POV-Ray : Newsgroups : povray.off-topic : Stupd linux file-moving question. Server Time
6 Nov 2024 00:27:42 EST (-0500)
  Stupd linux file-moving question. (Message 1 to 4 of 4)  
From: gregjohn
Subject: Stupd linux file-moving question.
Date: 18 Sep 2008 22:20:00
Message: <web.48d30c239db82e8f34d207310@news.povray.org>
After combining sets of files on two computers, to my horror I found out that
I'd done it incorrectly.  What I now have is:


/home/greg/files/author1/bookone/  (with chapters as files)
/home/greg/files/files/author1/booktwo/  (with chapters as files)

several times over

Now, I want to merge it all.  I am afraid that if I go to the
/home/greg/files/files/author1/booktwo directory and simply MOVE it with
Overwrite to the /home/greg/files/ directory, I will delete
/home/greg/files/author1/bookone.

Am afraid that I have to go to every  /home/greg/files/authorx/booky, and move
each bookx file to /home/greg/files/authorx.   That would be soul-crushing
tedium.

Do I have anything to fear?


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Stupd linux file-moving question.
Date: 18 Sep 2008 23:55:15
Message: <48d322a3$1@news.povray.org>
gregjohn wrote:
> /home/greg/files/author1/bookone/  (with chapters as files)
> /home/greg/files/files/author1/booktwo/  (with chapters as files)
> 
> several times over
> 
> Now, I want to merge it all.  I am afraid that if I go to the
> /home/greg/files/files/author1/booktwo directory and simply MOVE it with
> Overwrite to the /home/greg/files/ directory, I will delete
> /home/greg/files/author1/bookone.

	Why not just create the directory:

/home/greg/files/author1/booktwo

	And move the files into that? It won't affect bookone. If you're using 
mv, then use the -i option - this will cause it to ask if it's 
overwriting. If it asks, then you're doing something wrong.

	Frankly, I don't do this kind of stuff in the command line if I'm 
worried about losing anything.

	I always use mc (Midnight commander). See if you can install it and 
learn to use it. It will be your friend for life. I've been using Norton 
Commander + Midnight Commander for 20+ years now.

	If you don't want to learn mc (although it is easy...), and if you're 
in a graphical environment, use a graphical program similar to what you 
may be used to in Windows. There are a bunch (a big bunch) of such 
programs. I'm not familiar with many, but I know of Konqueror.

-- 
Inoculatte: To take coffee intravenously when you are running late.


                     /\  /\               /\  /
                    /  \/  \ u e e n     /  \/  a w a z
                        >>>>>>mue### [at] nawazorg<<<<<<
                                    anl


Post a reply to this message

From: Warp
Subject: Re: Stupd linux file-moving question.
Date: 19 Sep 2008 04:09:03
Message: <48d35e1f@news.povray.org>
gregjohn <pte### [at] yahoocom> wrote:
> Now, I want to merge it all.  I am afraid that if I go to the
> /home/greg/files/files/author1/booktwo directory and simply MOVE it with
> Overwrite to the /home/greg/files/ directory, I will delete
> /home/greg/files/author1/bookone.

  If everything else fails, you can try a trick like this:

(cd source;tar cf - .)|(cd target; tar xvf -)

  Or you could try something like this:

cd /home/greg/files/files/
find -type d | while read name; do mkdir "/home/greg/files/$name"; done

(which will recreate the directory structure)

find -type f | while read name; do echo mv "$name" "/home/greg/files/$name"; done

(which will move the files)

  Disclaimer: This is completely untested. Use at your own risk.

-- 
                                                          - Warp


Post a reply to this message

From: Jim Henderson
Subject: Re: Stupd linux file-moving question.
Date: 19 Sep 2008 16:51:39
Message: <48d410db$1@news.povray.org>
On Thu, 18 Sep 2008 22:19:15 -0400, gregjohn wrote:

> After combining sets of files on two computers, to my horror I found out
> that I'd done it incorrectly.  What I now have is:
> 
> 
> /home/greg/files/author1/bookone/  (with chapters as files)
> /home/greg/files/files/author1/booktwo/  (with chapters as files)
> 
> several times over
> 
> Now, I want to merge it all.  I am afraid that if I go to the
> /home/greg/files/files/author1/booktwo directory and simply MOVE it with
> Overwrite to the /home/greg/files/ directory, I will delete
> /home/greg/files/author1/bookone.
> 
> Am afraid that I have to go to every  /home/greg/files/authorx/booky,
> and move each bookx file to /home/greg/files/authorx.   That would be
> soul-crushing tedium.
> 
> Do I have anything to fear?

Is the problem that you have files/files in the path?

If it is, rename the first "files" to a dummy name, then change to that 
directory and do a "mv files .." - that should do the trick.

If you're unsure, create a small test structure and give it a try....

Jim


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.