What does the @ (at) symbol before a filename mean in a curl command?

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?

Asked By: robingrindrod

||

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.
Answered By: Ulrich Dangel
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.