-7

The manual for GNU cp says

-a, --archive
same as -dR --preserve=all

What is the meaning of "archive" here (which I assume radically different than with tar or zip)?

Edit: I should have read -d and -R right afterwards, at least to save time; I think --preserve=all after them made a cognitive bias preventing me from thinking I should do so; although I personally would put any shortcut argument (such as -a) in a designated chapter in the end of the argument glossary, and not in its start.

closed as unclear what you're asking by muru, mosvy, vonbrand, Inian, Anthony Geoghegan Aug 22 at 9:27

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • But didn't you just give an answer in the question? – 炸鱼薯条德里克 Aug 18 at 9:58
  • I'd prefer to start with the start... Not jump to the middle, than back to the start... – JohnDoea Aug 18 at 10:21
  • Alphabetical list can not all way be understood by reading in order. An aardvark is an animal that eats (what is animal, eats, is, an, that…?) – ctrl-alt-delor Aug 18 at 15:50
  • The --archive is a flag in long form. It could as well be --xglerb for all you care. Sure, it is meant to give a hint at what is does (to English speakers, that is; if you only speak Esperanto --xglerb is exactly as informative). – vonbrand Aug 19 at 20:16
2

You should just go to further into cp manual:

-a, --archive same as -dR

Let's check what -d is:

-d same as --no-dereference --preserve=links

Basically, this option tell to copy links as such and preserve the mode, ownership and timestamps of every file.

-R, -r, --recursive copy directories recursively

This option is pretty straightforward: it tells cp to copy downwards the folder tree.

What you can say from these is that "archive", in this case, seemed to mean to copy a folder and its subfolders, while preserving file attributes and links (and not copying the files they are referring to).

In other words, there is no special meaning behind the word "archive" in that context.

One should not overthink documentation.

Please do not mistake it with the option --backup.

Not the answer you're looking for? Browse other questions tagged or ask your own question.