By default when you do an HTTP GET/POST/PUT/DELETE method request using the cURL command, the output is displayed on the console (standard output)
In order to save the output of a cURL command to a file make use of the -o or --output option followed by the filename and the URL.
Example:% curl -o sample.csv https://code2care.org/sample.csv
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 59 100 59 0 0 621 0 --:--:-- --:--:-- --:--:-- 670
% cat sample.csv
1,Sample-1,100
2,Sample-2,200
3,Sample-3,300
4,Sample-4,400

Note: Make use of -O (capital letter O) if you want to save the file as that at the remote location.
Example:% curl -O https://code2care.org/sample.csv
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 59 100 59 0 0 612 0 --:--:-- --:--:-- --:--:-- 655

-
Have Questions? Post them here!
More Posts related to cURL,
- How to set Connection and Max Timeout for cURL Request with Examples
- cURL Option to show HTTP Response Status Code
- [fix] command not found curl
- Perform Basic Authentication using cURL with Examples
- Hide cURL Outputs and Errors on Terminal
- cURL Example using IP (IPv4 and IPv6) address and Port
- List of 28 Protocols supported by cURL with Examples
- Save cURL Command Output to a external file
- Get cURL command from Chrome Inspect Network HTTP URL
- URL Encode cURL HTTP GET\POST Data with Examples
- Efficient way to perform HTTP cURL GET/POST Requests with Payload
- Trace using cURL Command Example
- Get the Size of HTTP Response using cURL Command (Content Length)
- Fetch only content-type using cURL Command
- How to get cURL Command to run in verbose mode?
More Posts:
- 🌗 List of Solar Eclipses in the year 2020-2021 🌑 - Science
- BeanDefinitionStoreException IOException parsing XML document from class path resource [spring.xml] - Java
- Have you noticed MacOS Ventura About this Mac look like Mac OS X - Mac-OS-X
- How to know the current shell you are logged in? - Bash
- Spotlight Search file path location on Mac OS X Mavericks or Yosemite - Mac-OS-X
- Android: Unknown error code during application install : - Android
- How to Upgrade Mac from Monterey to macOS Ventura - MacOS
- Install GCC on M1/M2 ARM Based Mac - MacOS