0

I've summarized a list of commands that accepts symbolic link options according to SUSv4-2018ed:

cd chgrp chown chmod cp find ln ls pax rm

The full list also includes their defaults and other related options supported (such as -h and -d), and I stored it on my HDD for reference.

I've previously seen (GNU documents if I was correct) referring to -P -L options as "physical" and "logical" respectively, and I think that's probably where the option letters come from, but the latest docs as of Nov 2019 refer to them as "--no-dereference" and "--dereference" now.

My question is: where do -P -L -H come from? Is it SUS, XPG, POSIX, SVID, or vendor documentation? And what do they initially stand for?

4
  • 1
    H is probably a variation of P where P was already taken (so they took the next alphabet in "physical")
    – muru
    Nov 22, 2019 at 0:33
  • @muru So when H was introduced, the sense of "physical" and "logical" had reversed?
    – DannyNiu
    Nov 22, 2019 at 1:39
  • 1
    I don't see how that can be said. IIRC -H is usually like -P, with an exception for command line arguments
    – muru
    Nov 22, 2019 at 1:55
  • @muru I see. Would you consider converting your comments into an answer? I find it plausibly acceptable.
    – DannyNiu
    Nov 22, 2019 at 2:11

2 Answers 2

2

P and L indeed refer to the physical symbolic link itself, and the logical file the symbolic link refers to.

If one goes to section A.3. subsection "symbolic link" of the Rationale volume of 2018 edition of the Single Unix Specification, all of -P -L -H are mentioned, and it says

-H (for half logical)

Thanks goes to Don Cragon (from Austin Group mailing list) for the pointer.

1
  • 1
    "Half logical" means, I believe, "resolve symbolic links given on the command line" (but not necessarily links encountered during walking a directory tree). But I'm not entirely sure.
    – Kusalananda
    Nov 22, 2019 at 10:04
0

The short flags are Posix. But they were same in BSD before afaik.
The long flags which are much clearer are gnu as far as I can see.

Indeed the P and L are from physical an logical, but many recent documentation does not use these terms to describe because they are hard to understand. The use the terms dereferenced/followed and such.
I personally would think the final file or directory is the physical stuff while the link itself is only logical stuff, but it is used the opposite way round (so evaluation the symlink physically or logically).

2
  • You didn't mention the -H flag.
    – DannyNiu
    Nov 22, 2019 at 7:41
  • There was no specific question about the meaning of -H and there is no gnu long option to compare. Though --half-dereference would be funny...
    – user301446
    Nov 22, 2019 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .