Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am looking at an example of a curl command that uses the @ symbol before the filename to post data to the server.

curl http://localhost/ --data-binary @file.txt

What does this mean? Does it insert the contents of the file into the command? Is it specific to curl?

share|improve this question

1 Answer 1

up vote 23 down vote accepted

It is specific to curl. From man curl:

--data-binary <data>
  (HTTP) This posts data exactly as specified with no extra processing whatsoever.
  If you start the data with the letter @, the rest should be a filename.  Data is
  posted in a similar manner as --data-ascii does, except that newlines are preserved
  and conversions are never done.

  If this option is used several times, the ones following the first will append data
  as described in -d, --data.
share|improve this answer
1  
I should have looked there. I was expecting it to be a shell thing though. Thanks a million. –  user1291332 Jul 14 at 14:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.