3 ms·
I don't like the abbreviation "pwd" at all, mainly because it looks too much like "password" which is also often abbreviated to "pwd". I prefer "cwd" which woul
by lifthrasiir 6y ago
I don't like the abbreviation "pwd" at all, mainly because it looks too much like "password" which is also often abbreviated to "pwd". I prefer "cwd" which would unambiguously mean the Current Working Directory.
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).
- ben509 6y agoWell, if we ever rewrite Unix, we can just go with "wd". 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.
- johnr2 6y ago> if we ever rewrite Unix, we can just go with "wd" Thus confusing anyone who uses the 'wd' hard disk driver. https://man.openbsd.org/wd https://man.openbsd.org/wd
- arexxbifs 6y agoThey sort of did rewrite Unix and it's called pwd there, too. :) https://9p.io/magic/man2html/1/pwd https://9p.io/magic/man2html/1/pwd
- Joker_vD 6y agoDOS actually has "chdir" as another name for "cd". 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).
- jle17 6y agoAnncient Unix also had chdir as the command name for cd. If I'm not mistaken it was changed to cd for v7 with the Bourne shell replacing the previous shell.
- forgotpwd16 6y agoWouldn't `setwd` (used by R alongside `getwd`) be a more consistent name?
- jle17 6y agoYes when reading the title I thought of <pwd.h> for reading passwd rather than of the command/variable. Also it's already called cwd in other places (like in /proc, at least on Linux) so that would be more consistent.