Home:ALL Converter>Delete file in linux server using curl command

Delete file in linux server using curl command

Ask Time:2018-06-08T22:09:55         Author:Riju Mahna

Json Formatter

I want to delete a file I saved in the linux server using curl command. Basically trying to achieve "rm -rf /myfolder/myFile.zip" using curl.

I tried this command. curl -X DELETE /myfolder/myFile.zip

But it throws an error : curl: (3) <url> malformed

I will ultimately need to run this via a java class, but for now, just trying to run it directly in linux to verify.

Am I missing some syntax here ? How can I provide a full url when I AM inside the very server ?

Author:Riju Mahna,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50762519/delete-file-in-linux-server-using-curl-command
yy