|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
|
|