use curl -o to set the directory instead of cd-ing into the directory
quotes around output option of curl
Change -o to —output
Add quotations
Create dirs
Add the -L option
Print out curl headers
Print out the cache dir