Download a File with cURL or Wget
Posted: Mon May 24, 2021 11:35 am America/New_York
The following allows you to download data from https://asdc.larc.nasa.gov/data/ using linux, a mac, or Windows with Cygin.
1) If you haven't before, create an authentication cookie that can be used with to access files behind the EarthData login page.
2) You can download data with the following commands:
or
You can learn more about these command line tools here:
https://www.gnu.org/software/wget/
https://curl.se/docs/
https://wiki.earthdata.nasa.gov/display ... L+And+Wget
1) If you haven't before, create an authentication cookie that can be used with to access files behind the EarthData login page.
Code: Select all
USERNAME=<your earthdata username>
PASSWORD=<your earthdata password>
cd ~
touch .netrc
echo "machine urs.earthdata.nasa.gov login $USERNAME password $PASSWORD" > .netrc
chmod 0600 .netrc
touch .urs_cookies
Code: Select all
URL=<your url here>
curl -b ~/.urs_cookies -c ~/.urs_cookies --remote-name --location --netrc $URL
Code: Select all
wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies --content-disposition $URL
https://www.gnu.org/software/wget/
https://curl.se/docs/
https://wiki.earthdata.nasa.gov/display ... L+And+Wget