jlevy / the-art-of-command-line

Master the command line, in one page
152.86k stars 14.54k forks source link

What about windows users? #165

Open dawoodjee opened 9 years ago

dawoodjee commented 9 years ago

I have seen mention of unix/Linux and Mac. But how can windows users benefit from this?

jlevy commented 9 years ago

The scope of this is Unix-style command line, so this only applies on Windows if you install Cygwin (as noted in the doc). Windows command line is different enough I don't think it should be the same guide.

Thanks!

dawoodjee commented 9 years ago

I see. Thanks

jlevy commented 8 years ago

Reopening given the scope has broadened and we now have PR #361. (Cygwin only, not true Windows command line.) @adam-je and others -- any thoughts on that?

JasonCoombs commented 8 years ago

I'm new to this project, and I'm wondering about a few things that may obviously not fit with its intended purpose. To respond with suggestions and contributions to PR #361 it would help me to have some discussion of whether The Art of Command Line can evolve to include entries for software developers specifically -- primarily but not exclusively developers of cross-platform open source and GNU-licensed Free Software -- and also entries for sysadmins specifically. If yes, then I wonder whether the organization of the document needs more than just platform-specific sections, perhaps it needs inline identification of variations for each command when there are variations of significance which are platform-specific or when the most useful form of the command for a developer or sysadmin is different from the command in the hands of an ordinary power user doing the things we do every day when we aren't programming or doing system/network administration.

The focus on Bash shell interactive command lines is fine, but in practice the power of shell scripting has migrated over the last two decades to finally (praise be to MinGW) be seriously available under Windows. Cygwin is also nifty, its POSIX design objective ("Portable Operating System Interface") fits with the Linux emphasis here and clearly most of The Art of Command Line is applicable under Cygwin, because Bash. However, Bash under MinGW serves a very different purpose (serious cross-platform open source application development toolchain intended to build Windows targets and sometimes cross-compile for other targets) compared to Cygwin (which is meant to be an interactive command-line, and provide for development of additional GNU commands or enhancements to GNU commands in a POSIX-compatible environment which has, in recent years, been explicitly and purposefully moved away from being intended as a GNU toolchain development environment for writing Windows software or building for Windows/Win32/Win64 targets).

I quote, from the Meta section: "The focus is on interactive Bash, though many tips apply to other shells and to general Bash scripting." "Many of the other items apply or can be installed on other Unices or OS X (or even Cygwin)."

As we consider adding a Windows-only section, or possibly adding inline edits/footnotes/etc to highlight any differences one would expect to encounter when Bashing on Windows, one of the first things I think is that in adding Windows instructions to The Art of Command Line it would be absurd to exclude PowerShell simply because PowerShell Is Not Bash (PSINB) (props to PINE).

https://en.wikipedia.org/wiki/Windows_PowerShell

The emphasis, however, should clearly be Bashing PowerShell. And PowerShell Bashing. For example, three of the top Google results for these different use cases:

http://stackoverflow.com/questions/1098786/run-bash-script-from-windows-powershell https://www.reddit.com/r/PowerShell/comments/3525o9/using_bash_to_run_powershell_script_and_output_to/ https://groups.google.com/forum/#!topic/controltier/GdsiCspE-gg

So there is plenty more to say on this subject, but I wanted to get the discussion going as I work on a write-up of specific suggestions and a contribution to the living document as we finish PR #361.

Remember, Bash is the "Bourne-Again Shell" so worshipping at its altar of awesomeness is both appropriate and hilarious. When we start the process of adding other (some would say opposing) philosophies of code (i.e. Windows) and useful ways (with good humor) to Bash Windows within the existing document, there may be some culture shock giving rise to disagreements.

https://en.wikipedia.org/wiki/Bash_(Unix_shell)

This living document can continue being The Art of Bourne-Again Command Line but it could also become part of the perpetual war between competing belief systems during the long arc of the decline of the evil empire and the rise of the rest. Personally I like the idea that The Art of Command Line would become the definitive repository of awesome for every command line in the history of code. But that requires a decision by the keepers of the editorial voice, and despite that this repository has 102 Contributors obviously the moral copyright to articulate its future rests with @jlevy alone.

dspinellis commented 8 years ago

@JasonCoombs thank you for your insightful comments. Given that the topic is interactive and programmatic use of the Unix shell and tools, I think MSYS2/MINGW should be mentioned only briefly in order to guide Windows developers who are looking for an alternative tool-chain to build native Windows applications.

Regarding the proposal to make the document more inclusive, I agree that this is for @jlevy to decide. I prefer to keep things portable, and therefore I typically script and document procedures based on the Bourne/POSIX shell. However, when contributing to the guide, I tried to espouse and follow the document's Bash/GNU-centric angle.

jlevy commented 8 years ago

Thank you @JasonCoombs and @dspinellis for the thoughtful comments.

With some topics, pragmatics is more pertinent than principle. In particular, I think good content+ownership should determine expansion of scope. @dspinellis 's additions in #361 on Cygwin are clear wins, and so I now think the guide should include at least those basic Cygwin-specific tips, just as it includes basic OS X tips.

In fact @dspinellis, would you be willing to be "maintainer" for the Windows section? If so I'll add you to the roles file so we credit you and remember to get your review on PRs (just as with translations).

In the future, agreed, it may be good to have at least a few more brief Powershell- or MSYS2/MINGW-related items to the Windows section, for context for those using Windows. I'd be glad to see additions like that if there are compelling PR(s) and if we have a maintainer for the Windows items. My own knowledge there is too limited to allow me to help with anything beyond style/scope.

I'll leave this issue open for now, so anyone willing to discuss and help with those items knows it's welcome!

dspinellis commented 8 years ago

@jlevy: happy to help as the Windows section's maintainer.