The myriad meanings of pwd in Unix systems
qmacro.org
qmacro.org
Specifically, a lot of the journey was based on the false assumption that manpages will explain abbreviations or naming decisions, and should contain the exact expand form of such deviations - an assumption especially silly for commands as ancient as these, whose names were chosen on a whim by the original authors who were known to be allergic to command names longer than 3 characters.
Finally, despite initial evidence suggesting "pwd" meaning "print working directory", and finally finding rather conclusive evidence for multics documentation showing that "pwd" is an abbreviation of an earlier "print_wdir", the conclusion ends up being "we'll never know for sure".
I don't know about you, but it seems like the author is in denial here.
And in Plan 9, also by Thompson et al, there's pwd and pbd, where pbd is described as "prints the base name of the working (current) directory."[0]
Three OS:es by the same guy(s) all have pwd, as abbreviated from "print" in the first one. So, yeah, it's "print".
Thinking more about that though, "cd" in the shell universally means "change (the current working) directory" but can also possibly mean the "current directory" as well (and DOS/Windows "cd" without arguments does print the current working directory). Note that similar abbreviations like "md" and "rd" are not as universal, as they are "mkdir" and "rmdir" in *nixes (for the good reason).
Because we know it's reading the current or present value, like any other command that reads a value.
And of course we're going to print it, that's the natural thing to do.
Thus confusing anyone who uses the 'wd' hard disk driver.
And of course, the POSIX interface for changing and querying the working directory are wonderfully consistently named chdir and getwd (or getcwd, where "c" stands for something).
"Print working (current) directory"
https://github.com/abs0/4.3BSD-Quasijarus/blob/main/bin/pwd....
And the manpage says:
"prints the pathname of the working (current) directory"
https://github.com/abs0/4.3BSD-Quasijarus/blob/main/man/man1...
> [...]
> UNIX PROGRAMMERS MANUAL - Seventh Edition, Volume 1 - January, 1979 [...]
> DESCRIPTION
> Pwd prints the pathname of the working (current) directory.
> I don’t know about you, but this historic document carries more weight for me than other sources I’ve come across, and it only serves here to undermine the credibility of the Wikipedia entry.
This line seems to be the crux of the article and I don't follow at all. I don't see how this undermines the credibility of the Wikipedia entry. What am I missing here?
The man page implies it stands for pathname, as in pathname of working directory.
I personally trust the Multics etymology. The original developers of UNIX had worked on Multics after all.
"pathname of working directory" is redundant, as is "process' working directory".
What I meant was: It is redundant in the sense that the pathname is the identifier of the working directory, and if I ask someone to identify something I will receive in answer an identifier.
I.e. If I were to ask a user at their computer "what is the current working directory?" and "what is the pathname of the current working directory?" I will get the same answer.
Really the manpage doesn't specify either way. If I were to force any meaning from the manpage, I would tend to go with the 1st word in the sentence starting the acronym, but it's not so much ambiguous as it is just simply not saying anything at all.
The original manpage doesn't give an etymology, so should be discarded as a source.
You could say the manpage says: "prints the PATHNAME of the WORKING (current) DIRECTORY" many commands "print" things, doesn't mean it part of the name
>I don't see any implication
How you do not see it? PATHNAME is the only thing that differentiate this command from others, many commands print things ...
It's not simply a set of the words with equal weights. Some words there are more important and define the command, some can be interchanged like : "print" .
You can use "displays", "sends to output" ... but you cannot change "pathname" without ruining the meaning.
Should be obvious, for those who downvote, or simple logic doesn't work for some?
Historical fact is determined by examining sources for how the authors and other contemporary people interpret them, not applying your own snap judgements to them.
Original article talks about MEANINGS of pwd. To determine meaning YOU imply that MEANING is defined ONLY by looking for historical fact, but it is how YOU interpret it. We can look for historical fact and find out that most of the commands literally printed on PAPER.
So IF we talk about MEANINGs, we can take into account historical fact but there is no much use for it, if it doesn't represent the MEANING!
There are no flaws in my logic. There are flows in your suggestion that we should discuss ONLY historical fact to determine MEANING.
>while the grandparent argument only requires that multiple readings be possible
while it does say about multiple readings possible, it uses caps used only in "PRINT" word. I merely pointed out to that imbalance by providing alternative, to ballance it back.
Then I went further and argued that multiple readings are inappropriate there, because it is naive to put the same weight to the words. Some words are ESSENTIAL and some can be used for almost any command in unix/linux. Even grandparent argument discarded manual as source. and we simply -do-not-know- historical fact, So I CAN use manual as source of interpretations in search for !MEANING! not historical fact, which is absent and not very useful even if it will be determined.
convinced ?
Typing it out, I should’ve known that’s incorrect
That said, when I first learned of it, the pronunciation of “present” was as in past/future.
When you type pwd you mean please do what pwd does.
npm nailed it, npm just means npm.
Also, "pwd -A" where A means ABSOLUTE is easier to remember than "-P" for physical. I never hear anyone talk about physical directories. When people are talking about resolving sym links they talk about absolute versus relative paths. Seems like a good historical research topic to understand why the canonical usage is "physical" that no one uses versus relative/absolute paths that are actually used.
The way I remember this: cwd -> curent working dir, pwd -> print working dir
'Pathname' is the ONLY thing that makes sense and useful.
And you can call it as you wish btw, it doesn't matter.
A variable holding this most often is called fwd, though (current working directory)
Then I did some thinking and research and there is the PWD environment variables. Might be interesting if that predates the pwd command or not.
What's $PWD? Same thing you get from `pwd` without forking.
- The kernel (as in 'system processes' like kswapd, the 'sys' in sysctl)
- The init system (as in 'systemd')
- The OS (as in 'updating the system')
(P)athname of (W)orking (D)rectory is the ONLY meaningful abbreviation.
It simply cannot be just Print Working Directory because there are many meaning of this. What to print about current directory exactly? The same goes for present or whatever ..
Manual states it precisely too about PATHNAME. Many commands print things, most of them do this , but we do not have pfind pgrep pls pcat etc ...
find, globally search regex and print, list, concatenate, change directory, make directory etc. are all commands. They all have some kind of imperative verb in there, so "print" fits that pattern.
Some commands become embedded so deep in your muscle memory that you’re going to bring them along with you, even if it occurs to you that the name doesn’t make much sense in the present working environment.
It does, but it made sense in the context of Multics, it doesn't in the context of Unix/Linux.
It only shows how unix was designed: "let's tweak a bit and see ... " not too impressive
TFA seems to be confused about this too.
Yes, if we had to create a backronym for this, then Pathname of Working Directory makes the most sense (to me anyway).
But, as others have said, that doesn't appear to be what it originally stood for.
We are suggesting it was very intellectual choice and thus we should stick to this BS forever, just because 'guru' was using paper instead of display and didn't think about the future.
https://www.youtube.com/watch?v=NTfOnGZUZDk
so, does it make me incorrect in general idea?
what about ls? echo?
I just thought I was offering an interesting fact about where "grep" comes from.