7 ms·
Tar and Curl Come to Windows
- stevemk14ebr 9y agocool. I want wget now
- DougN7 9y agoI’ve been using wget on Windows for years, though it’s not built in.
- freeone3000 9y agoInvoke-WebRequest is good enough for a lot of use cases. Curl should handle the rest.
- johnramsden 9y agoGot to love their naming scheme, Invoke-WebRequest url just flows off your fingers.
- lstamour 9y agoI think it can be shortened to “iwr” (it’s aliased to “curl”)
- WorldMaker 9y agoIt's also aliased to wget. The Verb-Noun verbosity of PowerShell is great for A) discovering new verb and noun combinations that you hadn't considered before (and Get-Verb gives you a list of common verbs), and B) for keeping scripts readable in the long term. Most every Verb-Noun has at least one shortcut alias, most based on common cmd/bash-isms (Get-ChildItem has gci, ls, and dir), and Get-Help on any Verb-Noun will list the aliases for you.
- WorldMaker 9y agoWith respect to (B): I do try to write out the full verbose names (Verb-Noun) when writing scripts, as a maintenance goal. At that point when you are writing a script the verbosity is often less of a problem because you can write in an IDE of your choice that provides strong auto-completion. (You can also get basic tab completion in the command prompt and use an IDE as your command prompt, if for some reason you are entirely allergic to the short aliases and want to spell out the full things even for random REPL work.)
- seuss1969 9y agoIt's possible to download a static executable of the latest Wget releases for Windows. They tend to work without any issues.
- JepZ 9y ago:D Sounds like there will be no Windows 11 but instead "GNU Windows" ;-)
- ciupicri 9y agoThough bsdtar and curl don't have a GPL license.
- jwilk 9y agoI'd rather say: bsdtar and curl are not GNU software. (Not all GNU software is under GPL.)
- theandrewbailey 9y agoI wouldn't be surprised if Windows was open-sourced within 20 years.
- timeimp 9y agoWho is this new Microsoft?!
- kylek 9y agoNew? https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguis...
- mayli 9y agoSo, you have curl and tar, but no pipe (|) on windows.
- rainbowmverse 9y agoPipe works fine. I just ran dir | clip to make sure.
- leggomylibro 9y agoHow about fork? Does this work? :(){ :|: & };:
- rainbowmverse 9y agoI may not be a console expert, but I do know not to run things unless I understand what they do. This is a bad joke. You might say it bombed.
- leggomylibro 9y agoWell you can and apparently did google it; it's just a fork bomb. It'll spawn new processes until the system figures out what is going on or chugs to a halt. It's not particularly harmful - modern systems tend to have process limits. But I guess it is Microsoft...ctrl+s first. Serious question, though; I'm sort of curious how the whole Windows/shell thing is coming along.
- jodrellblank 9y agoinstall it on Linux and see for yourself https://github.com/PowerShell/PowerShell https://github.com/PowerShell/PowerShell
- Sophira 9y agoPipes have existed in DOS since before Windows 95 was around!
- ISL 9y agoStill no X, correct?
- Kipters 9y agoI don't think it would give them strategical advantage
- ISL 9y agoIt would allow me to function normally on a windows box. I can apt-get install everything I need except anything that depends on X. I'd still rather run GNU/Linux from the metal up, but my work depends on Windows for legacy data-acquisition systems. Right now, I have an experiment that's running a linux box and windows box side by side in order to get the best of both. Working out hardware access in a VM sounds unpleasant, so I'd love to see the native-windows-GNU implementation extended to X.
- freeone3000 9y agovcxsrv implements an x server in win32. Might be worth a try.
- ISL 9y agoThere are several implementations of X for win32/64 (there's a good one in Cygwin)-- I'm looking for something integrated with Microsoft's bare-metal implementation of Ubuntu. TL;DR: I want to 'apt-get install lyx octave gnuplot chromium darktable' with full functionality.
- derekp7 9y agoI'm looking for a Windows tar implementation that can save/restore Windows ACLs/DACLs and/or other extended attributes. Was thinking of taking the Red Hat GNU tar patches that handle Linux xattrs and SElinux attributes, and adapting the same technique for Windows, but haven't learned enough of the Windows API yet to make it happen. As for getting that info stored into the tar file, I believe this can be done by using PAX tar format (which can take any arbitrary name/value pairs without losing tar compatibility). Specifically, I need this functionality to make my backup program (Snebu) more useful to Windows users, as it relies on an installed tar implementation on a client to gather files. If anyone here is skilled in the Windows API and is interested in helping with this, let me know.
- eps 9y agoYou want NtQuerySecurityObject to get a binary SD blob, convert it to a SDDL (text) format using respective API and store the result.
- Const-me 9y agoThat thing’s unsupported for user mode apps. The correct API is GetSecurityInfo(). The main problem with backup/restore these things is SIDs. Windows ACLs are much more sophisticated then these 6 bits in Linux. It will work in some cases, e.g. when the owners are, and all the permissions are granted/denied to, a well known (1) group such as "Everyone". Or when all these SIDs are domain users SIDs, and you’re restoring to a PC that’s on the same domain. It won’t work in many other cases, e.g. when these permissions were granted to some local user and you’ve reinstalled Windows between backup & restore. That’s why in Windows it is typically considered OK to not bother backing up/restoring these ACLs. (1) https://msdn.microsoft.com/en-us/library/windows/desktop/aa379649(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...
- derekp7 9y agoThanks, I will read up on that. The problem I'm trying to solve, is I tried restoring c:\Users from a tar backup backup, and it took quite a while of clicking to get all the permissions sorted out. As for "permissions were granted to some local user", in the tar file format it stores a UID/GID number, as well as a username/groupname, so when restoring to a different system the username takes precedence over the UID number. Could the same idea work on Windows? (Granted, I'd probably have to store this in the PAX header's name/value pairs, due to potentially longer length of the UID numbers). The other item I've read is that Windows file permissions can be inherited from parent objects, so it may be useful to store those permissions, but not restore them (or give a warning if the effective permissions end up being different due to restoring to a different location).
- sonofgod 9y agoWondering how long it'll be before we have `curl ... | cmd` as standard installation instructions on Windows. (Probably a while: command line familiarity is far from a given in Windows)
- deleted 9y ago[deleted]
- 13of40 9y agoUsing PowerShell to download and execute a scriptblock is a common malware technique right now, but it's not something any sane software vendor would recommend for installing an application.
- freeone3000 9y agoThat's what the Linux folks thought, and here we are.
- draw_down 9y agoAh yes, the Linux folks. That famous group of people.
- tinalumfoil 9y agoIf I'm not mistaken executing a remote unsigned powershell script is the recommended installation for chocolatey.
- 616c 9y agoJust like open source dev tools in Linux I see plenty in Windows, like chocolately package manager and others, recommend just that.
- a3n 9y agoCygwin.
- xellisx 9y agoIf they would add SSH drive mapping...
- amckinlay 9y agoExcellent. But we could have had this years ago had Microsoft maintained an up to date and standards-compliant C library instead of promoting their insular and proprietary "visual" C++ ecosystem. In fact, there probably could be a whole host of GNU/Linux software running on Windows. But no, we can't even get a complete C99 library.
- slededit 9y agoMicrosoft moved to C++ a decade ago, the C compiler exists only for backwards compatibility and generates substandard code vs the same file compiled through the C++ compiler. C features are only supported as required by the C++ standard, although I personally miss VLAs.
- pritambaral 9y agoC and C++ are not alternatives, so a platform "moving to" one doesn't mean it has to forego the other. Linux, the BSDs, macOS all have both C and C++ toolchains.
- slededit 9y agoI'm just explaining what they did. They obviously could have continued to support C if they wanted. But if your waiting for C99 support your wait is in vain. These days you can use clang so a nice C compiler has returned.
- smilekzs 9y ago> Developers! Developers! Developers! A laughing stock turned into a respectable trend. Well done. I think with this, PowerShell needs to stop aliasing curl to Invoke-WebRequest by default (or at least try to deprecate that alias).
- WorldMaker 9y agoThe comments to the article address the PowerShell alias: it sounds like PowerShell is hesitant to change that alias and break the users that do expect curl to alias Invoke-WebRequest, so the suggestion was to get into the habit of using `curl.exe` as your invoke in PowerShell for real curl. A deprecation warning would be a good idea, though, to suggest to developers that are using the curl alias to move to iwr.
- qplex 9y agoWhat is this ad campaign Microsoft is pulling? Porting simple UNIX tools from the 70-80s to Windows and making a big fuzz about it? Tar? unzip.exe or whatever equivalent with a gui has been around for ages. I just can't see how any self-respecting developer would be lured to Windows by this...
- interfixus 9y agoThe ancients knew this technology. Around 1990, tar.exe came bundled into some OEM edition(s?) of MS-DOS, I don't specifically remember which.
- rijoja 9y agoThat's nice but why is the example with zip files?