MKB MKB - 1 month ago 10
Bash Question

How to append a file with the existing one using CURL?

I've searched all over the web but couldn't find anything useful for this. Using CURL, I want to append content to a file which is already existing and named as

test.pls
. Can anyone please tell me how can I do it using curl. The commands I've tried are

curl http://192.99.8.170:8098/stream --output test.pls

curl -K --output test.pls http://192.99.8.170:8098/stream

curl -a --output test.pls http://192.99.8.170:8098/stream


But all of above starts creating files from scratch.They don't keep the initial content of file Can anyone please help me!

Answer

Use the shell's appending output redirection (>>) rather than curl's --output option.

curl http://192.99.8.170:8098/stream >> test.pls
Comments