Question

I want to be able to save a data stream which i am returning using the curl command. I have tried using the cat command, and piping it the curl command, however i'm doing it wrong. The code im currently using is:

cat > file.txt | curl http://datastream.com/data

Any help would be appreciated.

Was it helpful?

Solution

Try:

curl http://datastream.com/data > output_file.txt

OTHER TIPS

So, you are using 'curl' to collect data, and want to capture its output?

curl http://example.com/data > file.txt

Or, indeed (from the man page):

curl -o file.txt http://example.com/data
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top