Live data from Hacker News

A Saner Windows Command Line

futurice.com

31–40 of 164 posts

Re: A Saner Windows Command Line

#31
post #19

I tried both ConEmu (twice) and Console2 in the past, but both were too unstable for regular use. If someone can convince me that the situation has markedly improved, I might try again, but I guess I'll just wait until we upgrade to Windows 10 at my workplace (which they say is any day now).

I use ConEmu daily. I wouldn't call myself a power user (e.g. I never have more than five tabs open at once), but I do use it regularly for a number of tasks.

In the past, say, six months, I cannot remember having any trouble with it.

Re: A Saner Windows Command Line

#32
Git for Windows is bundled with Git-Bash. A very Linux-like commande line. Works like a charm.

I also use MobaXTerm as my Putty replacement. It also comes with a Bash terminal that works fine. Very handy!

(Two reasons why I love to have learnt Bash)

Re: A Saner Windows Command Line

#34
I develop on Windows and use cmd.exe daily (for simpler tasks like running Gulp or PhantomJS). It's hard to overstate how much of an improvement Windows 10 brings to the command line. Keyboard cut and paste, resizing, better text selection seem so wonderful. It's a crime it took Microsoft this long for these simple features.

There's also other handy improvements, like typing "cmd" into the file explorer location bar to open a command window to the current location you are viewing.

Re: A Saner Windows Command Line

#35

Powershell and its long winded cmdlets are really hard for me to like. I always fall back to cygwin on windows. I once wrote a PS script to set some power management options on a corporate laptop. The script was 11 lines long (vs 3 lines in Python), it was harder to read and understand. Even with ISE available it was much harder to write. I followed along with some exchange server tutorial where the prescribed easy w…

One thing is that Powershell has some built-in "cmdlets" which would be buried in the filesystem (and not in the PATH) otherwise. I'm thinking specifically about the PS equivalent of signtool.exe, which is normally in an SDK path under program files (x86) depending on which SDK(s) you have installed.

Do I remember the name of the signing cmdlet(s)? Nope! Is this really better than just using alias, or changing the PATH? Probably not.

Another reason is vendor support. For example, VMware publishes a set of PS cmdlets as 'PowerCLI' for doing stuff in vSphere, but if you want to do something outside PS you're going to have to script/code against an SDK. I suspect there are other vendors doing the same thing. That may be a PS benefit. I usually end up writing a script instead although I found e.g. bulk movement of VMs from one set of datastores to another easier in PS.

The final thing I can think of is that there are a few situations where maybe you want things to stay in-process, and you get that w/ PS whereas you wouldn't with bash. An example I have is a script that facilitates remote deployment of an MSI with impersonation of a user on the remote machine. This is pretty straightforward with a WMIObject in PS, but not in cygwin bash since Windows doesn't really have sudo or su -c (runas only works interactively) and wmic doesn't offer any impersonation capability.

None of the above are really compelling for me, I end up spending 99+% of my time in bash/tmux/mintty.

Re: A Saner Windows Command Line

#36
> One of the reasons you use Windows is so you don't have to use the command line.

It's the other way around: One of the reasons I don't use Windows is because I have to use the command line.

Re: A Saner Windows Command Line

#37
post #16

Earlier quoted context omitted.

Learning Bash is just as cryptic. At least powershell function names have logic behind them.

I've only been working professionally with linux for 5-ish years, but i'd say that i'm still at the "2 googles per command" number for bash. Some of it stems from the fact that i just don't use it enough, but most of it from the fact that this shit just isn't intuitive. why is -b the flag for key length in ssh-keygen? Why is -v the flag for "don't include" in grep? I have those memorized now, but there is no way they…

> Some of it stems from the fact that i just don't use it enough, but most of it from the fact that this shit just isn't intuitive.

I have exactly the same problem.

I use Linux since about 8 years but somehow I just don't use the commandline very often so I forget stuff all the time. Because of this I have half a dozen post-its glued to my monitor for all the grep/git/whatever tricks I just can't keep in my head. And for other stuff I use about once a year I have a long linux_tricks.txt on my desktop where I write down all the tricky and obscure command line stuff.

Re: A Saner Windows Command Line

#38

Powershell and its long winded cmdlets are really hard for me to like. I always fall back to cygwin on windows. I once wrote a PS script to set some power management options on a corporate laptop. The script was 11 lines long (vs 3 lines in Python), it was harder to read and understand. Even with ISE available it was much harder to write. I followed along with some exchange server tutorial where the prescribed easy w…

I guess the difference between bash scripting and powershell scripting is that you have to learn a lot of things upfront to be productive with Powershell. Bash, on the other hand, with its simpler syntax and collection of text based utilities you can get productive pretty quickly. If you want more power or if you want cleaner code you can always switch to Python et al. Thus, the learning curve is much more gentle. The latter embodies tinkering spirit and self-learning and the former shows its enterprise nature.

Re: A Saner Windows Command Line

#39

Earlier quoted context omitted.

I've only been working professionally with linux for 5-ish years, but i'd say that i'm still at the "2 googles per command" number for bash. Some of it stems from the fact that i just don't use it enough, but most of it from the fact that this shit just isn't intuitive. why is -b the flag for key length in ssh-keygen? Why is -v the flag for "don't include" in grep? I have those memorized now, but there is no way they…

> Some of it stems from the fact that i just don't use it enough, but most of it from the fact that this shit just isn't intuitive. I have exactly the same problem. I use Linux since about 8 years but somehow I just don't use the commandline very often so I forget stuff all the time. Because of this I have half a dozen post-its glued to my monitor for all the grep/git/whatever tricks I just can't keep in my head. And…

Holy shit git!

I need to reset my git repo to match origin, is it git reset hard --HEAD or git reset HEAD --hard?

I'm like 90% sure they switch it with every update.

Re: A Saner Windows Command Line

#40
post #9
post #6

> "And, purely subjectively, I think the .ps1 syntax is a lot more readable than the old .bat syntax." The Author does say "subjectively" but in my experience, both personally and with others, the reverse is true. Powershell can seem to be really cryptic.

Bash can be _extremely_ cryptic as well, we just learned it over time. Look at awk :)

Why use bash when you can use Python with os and sys modules?
Post reply on HN