I want to download a tar of a git repo and extract its contents to another folder.
The following line (broken up for clarity) works:
curl -L -0 nt-dotfiles.tar.gz \ | tar --strip-components=1 -zx -C ~/Documents/dotfilesbut gives gives this error:
curl: (6) Could not resolve host: nt-dotfiles.tar.gz; nodename nor servname provided, or not known
I'm fine with leaving things as-is (because it still works) but I'm curious about the error, and would feel better if it went away.
Thanks!
22 Answers
Your syntax should be: curl -L -o nt-dotfiles.tar.gz ... You are using a zero instead of lower case 'Oh'. Zero forces curl to use http1.0. 'o' provides an output filename.
From the man page:
-0, --http1.0 (HTTP) Forces curl to issue its requests using HTTP 1.0 instead of using its internally preferred: HTTP 1.1.
-o, --output <file> Write output to <file> instead of stdout. If you are using {} or [] to fetch multiple documents, you can use '#' followed by a number in the <file> specifier. That variable will be replaced with the current string for the URL being fetched. Like in: curl -o "file_#1.txt" 4 You may try:
$ curl -s | tar xvf - -C dest/ 0