69 points · by quyleanh · 6y ago · 64 comments
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).
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).
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.
"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.
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?
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".
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 ...
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.
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.
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.