Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downloading files with curl [closed]

Tags:

linux

curl

ubuntu

I tried downloading the csv files from this repository from the command line of ubuntu 20.
What i have tried so far:

curl --output /home/../test2.csv https://cloudstor.aarnet.edu.au/plus/s/2DhnLGDdEECo4ys/download?path=%2FUNSW-NB15%20-%20CSV%20Files&files=UNSW-NB15_1.csv

However this creates a csv with unknown characters as input that can't be opened by excel ( if i download it from the browser everything is ok).
Any ideas?

like image 689
Los Avatar asked Aug 31 '25 14:08

Los


1 Answers

Your url https://example.net/xxx/download?path=yyy&files=zzz.csv contains a &, so your shell will cut the url on that character and try to download only https://example.net/xxx/download?path=yyy and launch curl in background.

To fix the problem, just use quotes ":

curl --output test.csv "https://example.net/xxx/download?path=yyy&files=zzz.csv"
like image 57
Mathieu Avatar answered Sep 09 '25 18:09

Mathieu