Gene E. Bloch said:
Gene E. Bloch wrote:
[Powershell]
The output of dir looks Unix-like, and pwd works as in Unix.
On a whim, I also tried ls. It looks like dir
ls -help produces an error message, and man help produces a help
message. But that help messsage is about Get-ChildItem, not about ls.
Help ls is the same as man ls, and changing ls to dir gives the same
message.
Go figure...
Well, guess what: Get-ChildItem is another synonym for ls and dir.
Nitpick: "Get-ChildItem" is the actual command. "ls" and "dir" are aliases
of Get-ChildItem, but that doesn't bring with them the syntax of the *NIX or
DOS command. ("gci" is another alias of get-childitem.)
So dir /s gives you an error message, but dir -r lists the current and
subordinate folder contents.
Similarly, cd and chdir are aliases of set-location, and pwd is an alias of
(surprise!) get-location. (And yes, pushd and popd are aliases of
push-location and pop-location.)
The "alias" command will list the current mappings between commands and
assigned alias names.
Joe
I actually purposely didn't say alias, since I felt that I was not in a
position to be sure I would've been using it correctly in the context of
PowerShell. In writing the post, I just took the liberty of using
"synonym" as a 'synonym' of alias, since as a non-technical term it
avoids any claims of exactitude.
Still, it should've been obvious even from what I wrote so hastily that
Get-ChildItem is the primary command, since I posted that the help
display showed Get-ChildItem as the name of the command.
Thanks for the clue about alias - if I ever open PowerShell again, I
hope I remember to use it
Clearly, PowerShell is different from the command prompt and the Unix
shells I've used, and apparently more complicated than the former[1], so
I doubt that I could use it effectively without a significant amount of
research.
I might get around to researching it, but the limited write-ups that
I've seen so far didn't tend to make it seem useful (OK,
comprehensible!) to me. It's obvious that the 5 or 10 minutes I've
devoted to it so far aren't enough.
[1] In a way, the command prompt is pretty complicated, partly because
of its limitations and partly because of its (IMO) strange syntax.