DOS Prompt Here vs. Open Command Window Here

  • Thread starter Six Underground
  • Start date
G

Gene E. Bloch

On my computer it looks like an oversized command window with a dark
blue background.

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.
 
J

Joe Morris

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
 
G

Gene E. Bloch

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.
 
S

Steve Hayes

On my computer it looks like an oversized command window with a dark
blue background.

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.
Ah, well that's definitely somethibng that doesn't work i n the standard
command shell:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Steve>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.
 
G

Gene E. Bloch

On my computer it looks like an oversized command window with a dark
blue background.

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.
Ah, well that's definitely somethibng that doesn't work i n the standard
command shell:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Steve>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.
ls is from Unix and its derivatives, not from DOS and its derivatives,
so that is to be expected.
 
S

Steve Hayes

On Tue, 09 Oct 2012 18:15:47 +0100, John Williamson wrote:

...winston wrote:
I've upgraded back to XP, so I can't check, but what does Powershell
appear as in Windows 7?

On my computer it looks like an oversized command window with a dark
blue background.

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.
Ah, well that's definitely somethibng that doesn't work i n the standard
command shell:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Steve>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.
ls is from Unix and its derivatives, not from DOS and its derivatives,
so that is to be expected.
That's why I didn't expect it, and had never tried it before.
 
G

Gene E. Bloch

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Steve>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.
ls is from Unix and its derivatives, not from DOS and its derivatives,
so that is to be expected.
That's why I didn't expect it, and had never tried it before.
OK, understood.

Actually, the reason I tried it (as well as pwd) in PowerShell is that
the output of dir looked like *nix ls output, so I wondered...

Since the real underlying command is Get-ChildItem, I guess I was just
lucky, rather than smart :)

Morally speaking, I really ought to read up a bit on PowerShell, since
it seems so bizarre to me. Like why on earth would "Get-ChildItem" be
the command to list a directory?
 
S

Stan Brown

Like why on earth would "Get-ChildItem" be
the command to list a directory?
Because if you envision the file system as a big tree, the root is
the drive letter, the branches are directories (folders) and
subdirectories, and the leaves are files. "Parent" and "child" are
standard terms for traversing a tree, although the tree is upside
down relative to a genealogical chart.

Come to think of it, just picture the genealogical chart and forget
the tree. :)
 
G

Gene E. Bloch

Because if you envision the file system as a big tree, the root is
the drive letter, the branches are directories (folders) and
subdirectories, and the leaves are files. "Parent" and "child" are
standard terms for traversing a tree, although the tree is upside
down relative to a genealogical chart.

Come to think of it, just picture the genealogical chart and forget
the tree. :)
Thanks. Very clear now.

And since you helped with that info, I no longer feel the need to read
the write-ups.

Kidding, of course, but I admit it's not on the front burner...yet.
 
S

Stan Brown

Thanks. Very clear now.

And since you helped with that info, I no longer feel the need to read
the write-ups.

Kidding, of course, but I admit it's not on the front burner...yet.
I'm a batch file enthusiast going way back to DOS 1.1. I got into
4DOS, then 4NT, now TCC/LE (successive versions of the shell from JP
Software) and have created many, many scripts.

I looked at PowerShell in 2010 when I got a computer with Windows 7.
Frankly, it looked too hard to learn for the additional benefit I
would get from it. Your mileage may vary, of course.
 
K

Ken Blake

I'm a batch file enthusiast going way back to DOS 1.1. I got into
4DOS,


I don't go as far back as DOS 1.1. I think I started with 3.0. But I
was a big 4DOS user. I once wrote a 4DOS batch file of something
around 4000 lines.
 
J

Joe Morris

Stan Brown said:
I looked at PowerShell in 2010 when I got a computer with Windows 7.
Frankly, it looked too hard to learn for the additional benefit I
would get from it. Your mileage may vary, of course.
PowerShell (aka "POSH") isn't something most people can come up to speed on
without study, but with experience and when accompanied by the appropriate
magic incantations it can do a lot of tasks that most scripting languages
cannot.

And as a practical matter, MS has indicated that it's going to be
deprecating the use of VBS in favor of POSH.

If you want to learn PowerShell I'll recommend _PowerShell In Action 2/e_ by
Bruce Payette, published by Manning (ISBN 978-1-935182-13-9, $59.99
including eBook). Payette was one of the designers of PowerShell and among
other items he explains some of the design decisions made during its
development. (This book - almost 1000 pages - covers version 2 which was
delivered with Windows 7.)

For some practical examples of POSH scripts try another Manning book,
_Powershell in Practice_ by Richard Siddaway (ISBN 978-1-935182-00-9, $49.99
including eBook).

Both books use examples you can download from Manning's web site.

Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top