4 ms·
Tips on using the Curl Command in Linux
- Yuioup 8y agocurl -C - -O http://yourdomain.com/yourfile.tar.gz Why the dash between the -C and -O?
- jdhendrickson 8y agoFrom the man page. Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out.
- saagarjha 8y agoCorrect me if I’m wrong, but usually “-“ is used (at least in my experience, which is strongly biased towards compilers) as an argument to signify input comes from standard in rather than a file.
- scolby33 8y agoThat's generally true in my experience too, but in this case the parent is correct. Ctrl-F "--continue-at" [0]. [0] https://curl.haxx.se/docs/manpage.html https://curl.haxx.se/docs/manpage.html
- saagarjha 8y agoYeah, I get that they're right. I just wanted to share my surprise that curl changes this "convention", though I guess it's to be expected because curl doesn't really take input anyways.
- sigjuice 8y agoThere is nothing particularly special about "-", but a lot of programs do use it for standard input like you said. e.g. awk, cat, diff. My macOS system has a quite a few of these grep -e '-.*standard input' /usr/share/man/man1/*
- maxxxxx 8y agoWorking with Windows mainly it always amazes me how powerful the command line tools in Linux are. Most Windows programmers don't know much about command line so downloading some files is a huge affair. If you know curl it's just so easy.
- deleted 8y ago[deleted]
- saagarjha 8y agoThat’s why I find it hard to convince people how annoying it is to use Windows for software development. It’s hard to miss what you aren’t aware of.
- mehrdadn 8y agoFunny, those of us who enjoy using Windows (esp. Visual Studio) for dev but are aware of how powerful command line tools are find it hard to convince you guys of the reverse in exactly the same way. We don't get the feeling you know what you're missing out on either. ;)
- g5095 8y agodon't. use httpie ;p
- fivre 8y agohttpie lacks a complete feature set in some cases, though day-to-day it's much nicer. I'll trade cURL's (admittedly clunky) --resolve, which is still necessary in some situations, for having native JSON pretty printing most of the time I also like that it's Python and I can probably change something in its source more easily and quickly than I can with cURL.
- maxnoe 8y ago`curl URL/File.tar.gz | tar xz` Download and decompress in one go
- kwhitefoot 8y agoA lot of services are using OAuth (or OAuth2) and I haven't been able to figure out how to use curl with such services. Can anyone point me at a good tutorial for using curl with Flickr in particular?
- canhascodez 8y agoI would probably not reach for curl as my first tool to interact with OAuth v2 datasources. Flickr seems to have a wide variety of available libraries[0], and they also have API documentation. Is there a good reason to use curl rather than something else? [0] https://www.flickr.com/services/api/ https://www.flickr.com/services/api/
- kwhitefoot 8y agoCurl is easily used in shell scripts.
- based2 8y agoSMTP send heap buffer overflow https://curl.haxx.se/docs/adv_2018-70a2.html https://curl.haxx.se/docs/adv_2018-70a2.html