begin quoting Ralph Shumaker as of Thu, Sep 22, 2005 at 02:07:46AM -0700:
> Stewart Stremler wrote:
>
> >What options are you passing to cp?
>
> I don't remember for sure. I was doing all this from Knoppix, so I
> don't have the command history. I also don't have around me the paper
> on which I wrote the switches I chose to use. Oops. I spoke to soon.
> The paper I most recently used (with knoppix v3.4) has:
As jhriv says, -a (an alias for -Rpd) can be useful. -R behaves slightly
differently than -r ...
> cd [source directory]
> cp -rvpd ./* [target directory]
>
> One other thing that was a bit odd was that this command copies just
> fine any dot files below the starting directory but ignores the dot
> files (in my case they were dot directories and their contents) that are
> actually in the starting directory.
Not _that_ odd. Globbing ignores dotfiles by default, so when you said
./*, it went to the dot directory (current directory) and expanded * to match
everything it's supposed to. The -r then recursively walks down any
source directories, and there it grabs all the dot-files and dot-dirs.
Try using just . instead of ./*, or use ./{.,}* ...
[snip]
> Sorry. I'm actually aware that most on the list use "ls -l" instead of
> "ll" because that's the way they say it in their descriptions of how to
> do things that include that. I just forgot that the "ll" alias,
> although apparently standard in RH, is not universal. "Oops." is about
> all I can say I reckon.
Well, when giving instructions or describing problems, it's generally
a good idea to (a) first try without local customizations (in case it's
the local customization that's causing the problem) and (b) give the
description without local customizations. I actually do have "ll" as
an alias for "ls -l" (and "la" as an alias for "ls -a" etc. etc.) on
many of my machines, but I put it there myself.
(And then there's "ls-F", just to add to the confusion.)
I'm not personally a big fan of shipping a system with a large default
set of customizations in place ... it just means you have to go and
unset a lot of crap to get back to a "vanilla" system.
[snip]
> Perhaps I'm just really tired, but I don't get what you're trying to say
> here. I get lines 1 and 3, but the purpose of line 2 eludes me. Also
> eluding me is why you're using "mv". I don't see how that relates to my
> question.
Don't worry about it. It doesn't work anyway. :(
> >Yes, that's expected.
>
> I don't understand why, although I think I have an idea. But my idea is
> immaterial. When it comes to the actual size of the directory copy, I
> would prefer that the size matches, but am satisfied if all of that
> directory's contents match.
A directory can be thought of a file who's contents are the names and
locations (on disk) of the files and subdirs in tha directory. When
you add something to a directory, it's name and disk location are
appended to the "directory file", and when you delete or move away a
file, that entry in the "directory file" is blanked out.
If you put a lot of files in a directory, it'll get bigger. If you then
delete most of 'em, you have a lot of blank space taking up room. When
you copy the special "directory file", it ignores the blank space and
copies just the names and locations, resulting in a smaller file.
This is, naturally, an oversimplification. But you get the idea, right?
[snip]
> Yeah, well, I just feel better when the copy seems to be a perfect
> copy. I would actually prefer to *know* that the copy is just as
> reliable as the original. And if the dates or sizes are different, it
> just *feels* like they are not reliably the same.
Well, directory sizes are expected to go down a little. I must admit
that I'm suprised that touch doesn't have a way to modify links.
-Stewart "Need to get my LFS system up!" Stremler
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list