Learn more. Asked 9 years, 3 months ago. Active 1 month ago. Viewed k times. I am using cURL to try to download all files in a certain directory. Improve this question. Martin Prikryl k 46 46 gold badges silver badges bronze badges. Alex Gordon Alex Gordon 50k gold badges silver badges bronze badges.
Do you want to download the whole directory and wildcard is not really relevant here or just some files in it matching the wildcard?
Are you bound to curl? To be honest, it's one of the most hard-to-use tools I've ever seen. What is your platform? Because in the post you mention bash, and in the answer comments you mentioned. Also, how is sftp relevant? And does your example actually use FTP? Show 1 more comment. Active Oldest Votes. The default maximum depth is five layers.
Improve this answer. When ssh is enabled you should be able to use scp as well and doing it with scp should be much easier: scp user ftp. You'll need to exchange SSH keys first to make that passwordless. Active Oldest Votes. The following line will download all the files to a directory mentioned by you.
Improve this answer. Worked for me too! I also needed the options ; --user user --password pass. If you are currently in a dir, say the Documents dir. How can I do the same behavior with curl? This is exactly what was aleeady in the question. The question was for selecting a directoriy but keeping the file name. Our sample file will be the readme for blcli, BitLaunch's command-line interface , which is hosted on GitHub.
In the case of our readme, the complete command would like this:. So what if we want to use cURL to save a file to our server?
For that, we must use the -O option:. You'll notice that cURL will display a download progress table rather than the file contents this time:. If you'd like the file to have a different file name perhaps readme is too bossy for you , specify it after -O :. Community Control Panel. Hacktoberfest Contribute to Open Source.
Launch an Interactive Terminal! About the authors. Brian Hogan. Still looking for an answer? Ask a question Search for more help. Comments Follow-Up Questions.
0コメント