0

When I try to view the zip file with curl the terminal is corrupted. And after that all the character we typed cannot be recognized as they will be shown as unrecognizable Unicode. I curl the zip below:

curl http://udacity.github.io/ud595-shell/stuff.zip

I am asking as I'm curious about this. How is this happening?

vusan
  • 115

2 Answers2

2

When using curl like that, it will output the contents of the Zip-file to the terminal (curl writes to standard output by default). This may well corrupt the terminal, just as when you cat a compressed file or any other binary file.

To save the file, use curl -O .... This will save the file with its original name (stuff.zip) in the current directory.

To save it with another name, use either curl -o newname ... or curl ... >newname.

Kusalananda
  • 333,661
1

curl reads the zip file and prints it to stdout. To redirect curls output to a file called stuff.zip you need to state

curl http://udacity.github.io/ud595-shell/stuff.zip -o stuff.zip

-o, --output FILE Write to FILE instead of stdout

Michael D.
  • 2,830