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

curlshell

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?

Best Answer

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.