man curl
entry for curl -O
says:cd /example
to download the file to a specific directory?wget
this way:curl
.curl
is designed.git clone https://github.com/curl/curl.git
) and study it. You'll find out that the chdir(2) system call is never used in it (it only appears in testing scripts coded in Perl).cd
in your shell before using curl
, you might use something else, or patch the curl
source code to add such an option (e.g. you could improve its code to accept some --chdir
dirname program option, and then call the chdir
syscall; in my opinion it is not worth the effort). Remember that each process has its ownworking directory (inherited from its parent process). See also credentials(7) and read some Linux programming book (perhaps the old, but freely downloadable, ALP; also intro(2) & syscalls(2))curl
with absolute paths only (consider using realpath(1) in your shell scripts, or realpath(3) in your C programs, to get one).curl
in some shell script doing what you want; maybe some incurl
script as simple as: Castle clash hack tool free download.incurl /tmp/ -O foo http://example.com/path/foobar.txt
(to get some /tmp/foo
from that URL).curl
is a command line software which does one thing, but does it well. You'll compose or wrap it with other utilities (perhaps as simple as the incurl
script above) to get more features. And sadly, curl
does not make your morning coffee either.