dir C:\
I have to learn to type List-Directory-With-Files Drive=C Folder=/
(made up example, but you get the point) dir C:\
I have to learn to type List-Directory-With-Files Drive=C Folder=/
(made up example, but you get the point)But all parameters on DIR and LS seem to result in errors, even "dir /h", "dir /?", "dir -h", "dir --help", etc. That is a bit annoying.
The issue already happened with cURL.
emacs some-old-file-i-dont-want.c
Emacs would be an alias for rm on my system.That being said I think it was quite offensive of MS to use wget and curl as aliases, even though they may have had no ill intentions. I'm ok with using ls and echo and names of other such basic commands as aliases, but with tools like wget and curl that are known for their vast array of useful features you either implement their features and options or you don't use their names.
Well, I can't do my typical ls -la either.
More seriously, how many seconds did it took for the PS to answer to that command?
Measure-Command {dir C:\}
TotalMilliseconds : 2.9708
Measure-Command {Get-ChildItem "C:\"}
TotalMilliseconds : 2.4161 PS> Measure-Command {Start-Process cmd -ArgumentList '/c dir c:\'}
TotalMilliseconds : 14.0138
PS> Measure-Command {gci C:\}
TotalMilliseconds : 10.7484
Second run on each of those went down to closer to 40% of each, yay caching.Of course, the start-process is possibly taking up a chunk of time, there. With no measure-command for cmd, it makes it a little harder to gauge.
c:\temp>timecmd dir c:\
Volume in drive C is Windows
Volume Serial Number is A0A8-6684
Directory of c:\
01/11/2016 12:45 <DIR> AMD
...
17/11/2016 12:52 <DIR> Windows
9 File(s) 25,337 bytes
18 Dir(s) 71,423,356,928 bytes free
command took 0:0:0.08 (0.08s total)
bat from http://stackoverflow.com/a/6209392[1] http://stackoverflow.com/questions/673523/how-to-measure-exe...
Measure-Command { gci C:\ }
TotalMilliseconds : 1.3334
It's pretty fastI don't know how many times I've been in a cmd shell and typed ls and then swore at things.
* cat.bat: type %1
* clear.bat: cls
* diff.bat: fc /n /w %1 %2
* ls.bat: dir /w %1%
* pwd.bat: cd
* touch.bat: echo . >> %1
* top.bat: tasklist
All have an @echo off at the top too. Touch is a little janky, because I couldn't figure out how to actually create an empty file with nothing in it from the command prompt.
I'm actually not really a Linux person, but on Mac you kinda have to use these, so I got more used to using them than the Windows counterparts.
copy nul %1 >nul
to get an empty file. It's not a replacement for touch, though, as touch will do something different to existing files. Your attempt will silently overwrite the file in that case.1 line file: @type %1
It is a short version for
Get-ChildItem -Directory C:/ ls c:\
or
gci c:\For example, if you type
dir | sort <TAB>
it suggests Attributes, BaseName, CreationTime, .... All properties of file objects (which is what dir returns).Also there is PowerShell ISE, which is a IDE for powershell, but I haven't really tried it yet.
Yes you can type -?, but that's as bad as having to go on the web to read the documentation. It's disruptive. The point of a good auto-complete is to have a list at your fingertips with a short description of what it does, without interrupting your train of thought.
You can press ctrl+space and it pops out a list of options to choose from, then you move with the arrow keys. It works for parameters and values (if there's a set to choose from):
I've taken a screenshot to illustrate: http://i.imgur.com/d7MVYma.png
The tab completion is not static either. If you type: ps <Tab>, it will tab through all the current processes.
I didn't know about the CTR+SPACE. That being said it doesn't seem much more insightful than TAB. And no description of what the argument does.
You'll never get a drop down list in the host terminal windows has it doesn't have a GUI layer like that. Wrap it in a electron app and make one.
you can type `dir -<tab>` and cycle through the options. type `get-help dir` to see what they do or install posh-git and use `dir -<ctrl-space>` to get a menu of options to choose. I didn't know about -?
Except you do, with PSReadline, built into Windows 10 PowerShell.
gci - then ctrl+space
The available parameters appear on the screen, you can select one with the arrow keys, and tab, when you choose one and press space, they all disappear again. It's interactive, dynamic, it changes depending on how much of the parameter name you've typed - it's not just printing to the screen and stuck there.